feat(logging-p0): add full-step logging to ERP automation and unify capturePageContext
Add ~45 structured log calls across extractor-core, cleaner, and erp-auth to cover all automation steps (navigation, query, download, material processing). Enhance capturePageContext with a step parameter for precise failure localization, and fix missing capturePageContext calls in error handlers. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,7 @@ export interface ErpErrorContext {
|
||||
pageUrl?: string
|
||||
frameHierarchy?: Array<{ name: string; url: string }>
|
||||
targetSelector?: string
|
||||
step?: string
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -22,7 +23,8 @@ export interface ErpErrorContext {
|
||||
*/
|
||||
export async function capturePageContext(
|
||||
page: Page,
|
||||
targetSelector?: string
|
||||
targetSelector?: string,
|
||||
step?: string
|
||||
): Promise<ErpErrorContext> {
|
||||
const ctx: ErpErrorContext = {}
|
||||
|
||||
@@ -43,5 +45,9 @@ export async function capturePageContext(
|
||||
ctx.targetSelector = targetSelector
|
||||
}
|
||||
|
||||
if (step) {
|
||||
ctx.step = step
|
||||
}
|
||||
|
||||
return ctx
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user