fix: ensure stack trace contains one line (#10317)
This commit is contained in:
parent
109f981beb
commit
bc0b04beef
@ -147,8 +147,11 @@ export function createClientError(
|
|||||||
const getErrorDetails = (details: Protocol.Runtime.ExceptionDetails) => {
|
const getErrorDetails = (details: Protocol.Runtime.ExceptionDetails) => {
|
||||||
let name = '';
|
let name = '';
|
||||||
let message: string;
|
let message: string;
|
||||||
const lines = details.exception?.description?.split('\n') ?? [];
|
const lines = details.exception?.description?.split('\n at ') ?? [];
|
||||||
const size = details.stackTrace?.callFrames.length ?? 0;
|
const size = Math.min(
|
||||||
|
details.stackTrace?.callFrames.length ?? 0,
|
||||||
|
lines.length - 1
|
||||||
|
);
|
||||||
lines.splice(-size, size);
|
lines.splice(-size, size);
|
||||||
if (details.exception?.className) {
|
if (details.exception?.className) {
|
||||||
name = details.exception.className;
|
name = details.exception.className;
|
||||||
|
Loading…
Reference in New Issue
Block a user