Skip to main content

错误

当某些操作异常终止时,例如浏览器在 page.evaluate() 运行时关闭,就会引发错误。所有 Playwright 异常都继承自此类。

¥Error is raised whenever certain operations are terminated abnormally, e.g. browser closes while page.evaluate() is running. All Playwright exceptions inherit from this class.


属性

¥Properties

message

Added in: v1.11 error.message

错误消息。

¥Message of the error.

用法

¥Usage

error.message

类型

¥Type


name

Added in: v1.11 error.name

浏览器中抛出的错误名称。可选的。

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

用法

¥Usage

error.name

类型

¥Type


stack

Added in: v1.11 error.stack

浏览器中抛出的错误堆栈。可选的。

¥Stack of the error which got thrown inside the browser. Optional.

用法

¥Usage

error.stack

类型

¥Type