WebError
WebError 类表示页面中抛出的未处理的异常。它是通过 BrowserContext.WebError 事件调度的。
¥WebError class represents an unhandled exception thrown in the page. It is dispatched via the BrowserContext.WebError event.
// Log all uncaught errors to the terminal
context.WebError += (_, webError) =>
{
Console.WriteLine("Uncaught exception: " + webError.Error);
};
方法
¥Methods
错误
¥Error
Added in: v1.38引发的未处理错误。
¥Unhandled error that was thrown.
用法
¥Usage
WebError.Error
返回
¥Returns
Page
Added in: v1.38产生此未处理异常的页面(如果有)。
¥The page that produced this unhandled exception, if any.
用法
¥Usage
WebError.Page
返回
¥Returns