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.

用法

error.message

类型


name

Added in: v1.11 error.name

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

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

用法

error.name

类型


stack

Added in: v1.11 error.stack

浏览器里扔出的错误堆栈。可选。

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

用法

error.stack

类型