Skip to content

feat: Add location() to WebError#39767

Open
cpAdm wants to merge 2 commits intomicrosoft:mainfrom
cpAdm:feat-location-weberror
Open

feat: Add location() to WebError#39767
cpAdm wants to merge 2 commits intomicrosoft:mainfrom
cpAdm:feat-location-weberror

Conversation

@cpAdm
Copy link
Copy Markdown
Contributor

@cpAdm cpAdm commented Mar 19, 2026

  • Sticked with same return type as ConsoleMessage.location()

Closes: #39687

return { message, stackLines, location };
}

export function errorLocationFromStack(error: Error | undefined, pathSeparator: string, showInternalStackFrames: boolean = false): {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code works for Node.js (V8), it does not work for errors in WebKit / Firefox.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new test passes for all browser. So I am not sure what to do?
image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should plumb the location all the way from the browser-specific protocol event to here. It should be already available in the protcol.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpAdm web error originates from the web page. That web page runs in the browser, it can be Firefox or WebKit. You can't parse Firefox error text in Node and assume it is coming from V8 - stack frame format is different.

@cpAdm cpAdm requested a review from pavelfeldman March 22, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add location to WebError

3 participants