{"record":{"id":"a1b3ff9589ba4d62","repo":"microsoft/playwright","slug":"error","errorCode":null,"errorMessage":"${error}","messagePattern":"\\$\\{error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/playwright-core/src/client/harRouter.ts","lineNumber":36,"sourceCode":"\nimport type { BrowserContext } from './browserContext';\nimport type { LocalUtils } from './localUtils';\nimport type { Route } from './network';\nimport type { Page } from './page';\nimport type { URLMatch } from '@isomorphic/urlMatch';\n\ntype HarNotFoundAction = 'abort' | 'fallback';\n\nexport class HarRouter {\n  private _localUtils: LocalUtils;\n  private _harId: string;\n  private _notFoundAction: HarNotFoundAction;\n  private _options: { urlMatch?: URLMatch; baseURL?: string; };\n\n  static async create(localUtils: LocalUtils, file: string, notFoundAction: HarNotFoundAction, options: { urlMatch?: URLMatch }): Promise<HarRouter> {\n    const { harId, error } = await localUtils.harOpen({ file });\n    if (error)\n      throw new Error(error);\n    return new HarRouter(localUtils, harId!, notFoundAction, options);\n  }\n\n  private constructor(localUtils: LocalUtils, harId: string, notFoundAction: HarNotFoundAction, options: { urlMatch?: URLMatch }) {\n    this._localUtils = localUtils;\n    this._harId = harId;\n    this._options = options;\n    this._notFoundAction = notFoundAction;\n  }\n\n  private async _handle(route: Route) {\n    const request = route.request();\n\n    const response = await this._localUtils.harLookup({\n      harId: this._harId,\n      url: request.url(),\n      method: request.method(),\n      headers: (await request.headersArray()),","sourceCodeStart":18,"sourceCodeEnd":54,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/playwright-core/src/client/harRouter.ts#L18-L54","documentation":"Error \"${error}\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/playwright-core/src/client/harRouter.ts:36 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}