From 1b771ed360285cd43ed66e5b1c5d43bd4e67c9c1 Mon Sep 17 00:00:00 2001 From: Max Schmitt Date: Wed, 28 Apr 2021 10:41:46 +0200 Subject: [PATCH] docs(python): add Error base class (#6315) --- docs/src/api/class-error.md | 26 ++++++++++++++++++++++++++ utils/doclint/documentation.js | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 docs/src/api/class-error.md diff --git a/docs/src/api/class-error.md b/docs/src/api/class-error.md new file mode 100644 index 0000000000000..02b75a2b0f3d1 --- /dev/null +++ b/docs/src/api/class-error.md @@ -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. diff --git a/utils/doclint/documentation.js b/utils/doclint/documentation.js index 8747f4ee0a56f..4073a34481d28 100644 --- a/utils/doclint/documentation.js +++ b/utils/doclint/documentation.js @@ -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) {