Skip to main content

WebError

WebError 类表示页面中抛出的未处理异常。它通过 BrowserContext.WebError 事件分发。

// Log all uncaught errors to the terminal
context.WebError += (_, webError) =>
{
Console.WriteLine("Uncaught exception: " + webError.Error);
};

方法

🌐 Methods

Error

Added in: v1.38 webError.Error

引发的未处理错误。

🌐 Unhandled error that was thrown.

用法

WebError.Error

返回


Page

Added in: v1.38 webError.Page

产生此未处理异常的页面(如果有)。

🌐 The page that produced this unhandled exception, if any.

用法

WebError.Page

返回