mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
fix: check if async error has a stack (#4017)
This commit is contained in:
parent
9db09fe7e9
commit
02b2451db5
@ -32,7 +32,7 @@ class Helper {
|
||||
return method.call(this, ...args).catch(e => {
|
||||
const stack = syncStack.stack.substring(syncStack.stack.indexOf('\n') + 1);
|
||||
const clientStack = stack.substring(stack.indexOf('\n'));
|
||||
if (!e.stack.includes(clientStack))
|
||||
if (e instanceof Error && e.stack && !e.stack.includes(clientStack))
|
||||
e.stack += '\n -- ASYNC --\n' + stack;
|
||||
throw e;
|
||||
});
|
||||
|
@ -109,7 +109,7 @@ class Helper {
|
||||
return method.call(this, ...args).catch(e => {
|
||||
const stack = syncStack.stack.substring(syncStack.stack.indexOf('\n') + 1);
|
||||
const clientStack = stack.substring(stack.indexOf('\n'));
|
||||
if (!e.stack.includes(clientStack))
|
||||
if (e instanceof Error && e.stack && !e.stack.includes(clientStack))
|
||||
e.stack += '\n -- ASYNC --\n' + stack;
|
||||
throw e;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user