mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Avoid capturing stack trace twice
Co-authored-by: Eric Mc Sween <eric.mcsween@overleaf.com>
This commit is contained in:
parent
6078aa963d
commit
fc197630be
1 changed files with 8 additions and 4 deletions
|
@ -54,10 +54,14 @@ class OError extends Error {
|
|||
|
||||
if (!oError._oErrorTags) oError._oErrorTags = []
|
||||
|
||||
const tag = new TaggedError(message, info)
|
||||
|
||||
// Hide this function in the stack trace.
|
||||
if (Error.captureStackTrace) Error.captureStackTrace(tag, OError.tag)
|
||||
let tag
|
||||
if (Error.captureStackTrace) {
|
||||
// Hide this function in the stack trace.
|
||||
tag = { name: 'TaggedError', message, info }
|
||||
Error.captureStackTrace(tag, OError.tag)
|
||||
} else {
|
||||
tag = new TaggedError(message, info)
|
||||
}
|
||||
|
||||
oError._oErrorTags.push(tag)
|
||||
|
||||
|
|
Loading…
Reference in a new issue