Skip to content

Commit

Permalink
docs(python): add Error base class (#6315)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxschmitt committed Apr 28, 2021
1 parent 0039b31 commit 1b771ed
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docs/src/api/class-error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# class: Error
* langs: python
* extends: [Exception]

Error is raised whenever certain operations are terminated abnormally, e.g.
browser closes while [`method: Page.evaluate`] is running. All Playwright exceptions
inherit from this class.

- [error.message](./api/class-error.mdx#errormessage)
- [error.name](./api/class-error.mdx#errorname)
- [error.stack](./api/class-error.mdx#errorstack)

## property: Error.message
- returns: <[str]>

Message of the error.

## property: Error.name
- returns: <[str]>

Name of the error which got thrown inside the browser. Optional.

## property: Error.stack
- returns: <[str]>

Stack of the error which got thrown inside the browser. Optional.
2 changes: 1 addition & 1 deletion utils/doclint/documentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class Documentation {
for (const [name, clazz] of this.classes.entries()) {
clazz.validateOrder(errors, clazz);

if (!clazz.extends || clazz.extends === 'EventEmitter' || clazz.extends === 'Error' || clazz.extends === 'RuntimeException')
if (!clazz.extends || ['EventEmitter', 'Error', 'Exception', 'RuntimeException'].includes(clazz.extends))
continue;
const superClass = this.classes.get(clazz.extends);
if (!superClass) {
Expand Down

0 comments on commit 1b771ed

Please sign in to comment.