(opts: {
devTools?: TargetUniverse;
error: Protocol.Runtime.RemoteObject;
targetId: string;
})
| 357 | } |
| 358 | |
| 359 | static async fromError(opts: { |
| 360 | devTools?: TargetUniverse; |
| 361 | error: Protocol.Runtime.RemoteObject; |
| 362 | targetId: string; |
| 363 | }): Promise<SymbolizedError> { |
| 364 | const details = await SymbolizedError.#getExceptionDetails( |
| 365 | opts.devTools, |
| 366 | opts.error, |
| 367 | opts.targetId, |
| 368 | ); |
| 369 | if (details) { |
| 370 | return SymbolizedError.fromDetails({ |
| 371 | details, |
| 372 | devTools: opts.devTools, |
| 373 | targetId: opts.targetId, |
| 374 | includeStackAndCause: true, |
| 375 | }); |
| 376 | } |
| 377 | |
| 378 | return new SymbolizedError( |
| 379 | SymbolizedError.#getMessageFromException(opts.error), |
| 380 | ); |
| 381 | } |
| 382 | |
| 383 | static #getMessage(details: Protocol.Runtime.ExceptionDetails): string { |
| 384 | // For Runtime.exceptionThrown with a present exception object, `details.text` will be "Uncaught" and |
no test coverage detected