Skip to content

Commit 1b771ed

Browse files
authored
docs(python): add Error base class (#6315)
1 parent 0039b31 commit 1b771ed

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

docs/src/api/class-error.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# class: Error
2+
* langs: python
3+
* extends: [Exception]
4+
5+
Error is raised whenever certain operations are terminated abnormally, e.g.
6+
browser closes while [`method: Page.evaluate`] is running. All Playwright exceptions
7+
inherit from this class.
8+
9+
- [error.message](./api/class-error.mdx#errormessage)
10+
- [error.name](./api/class-error.mdx#errorname)
11+
- [error.stack](./api/class-error.mdx#errorstack)
12+
13+
## property: Error.message
14+
- returns: <[str]>
15+
16+
Message of the error.
17+
18+
## property: Error.name
19+
- returns: <[str]>
20+
21+
Name of the error which got thrown inside the browser. Optional.
22+
23+
## property: Error.stack
24+
- returns: <[str]>
25+
26+
Stack of the error which got thrown inside the browser. Optional.

utils/doclint/documentation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Documentation {
6868
for (const [name, clazz] of this.classes.entries()) {
6969
clazz.validateOrder(errors, clazz);
7070

71-
if (!clazz.extends || clazz.extends === 'EventEmitter' || clazz.extends === 'Error' || clazz.extends === 'RuntimeException')
71+
if (!clazz.extends || ['EventEmitter', 'Error', 'Exception', 'RuntimeException'].includes(clazz.extends))
7272
continue;
7373
const superClass = this.classes.get(clazz.extends);
7474
if (!superClass) {

0 commit comments

Comments
 (0)