feat(logging-p0): replace console.* with logger and add error logging before ERP throws
Eliminate console.* remnants in bootstrap, session-manager, migrations, and app entry so startup and login failures are captured in log files. Add log.error before all 14 throw sites in ERP services (auth, extractor, cleaner, browser manager) to ensure critical automation failures are traceable. Introduce capturePageContext utility for defensive Playwright page state capture during error logging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -195,6 +195,10 @@ export class ErpBrowserManager {
|
||||
async navigate(url: string, options?: { timeout?: number }): Promise<void> {
|
||||
const page = this.session?.page
|
||||
if (!page) {
|
||||
log.error('No page available for navigation', {
|
||||
url,
|
||||
hasSession: !!this.session
|
||||
})
|
||||
throw new Error('No page available. Call initialize() first.')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user