Skip to content

[Feature]: Access to exception details #1939

Description

@kiddkaffeine

🚀 Feature Request

When Playwright throws an Exception, the message often looks like:

Error: {
   message='net::ERR_NAME_NOT_RESOLVED at https://this.does.not.exist.microsoft.com/
   name='Error
   stack=....
}
Call log:
....

We have had to write some regexs to attempt to extract these details. Should PlaywrightException and it subclasses perhaps have convenience methods to return these details?

Example

PlaywrightException has several additional methods that would return the message, name, and stack fields, as well as the call log.

Motivation

This information is often helpful in identifying the cause of errors and handling or cataloguing them correctly. Currently, it often requires regex's or special methods to extract, which other users have to create, and could break in future versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions