MCPcopy Create free account
hub / github.com/ChromeDevTools/chrome-devtools-mcp / fromError

Method fromError

src/devtools/DevtoolsUtils.ts:359–381  ·  view source on GitHub ↗
(opts: {
    devTools?: TargetUniverse;
    error: Protocol.Runtime.RemoteObject;
    targetId: string;
  })

Source from the content-addressed store, hash-verified

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

Callers 2

fromMethod · 0.80
fromDetailsMethod · 0.80

Calls 3

#getExceptionDetailsMethod · 0.80
fromDetailsMethod · 0.80

Tested by

no test coverage detected