mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
recreate Error objects from plain objects when logging to sentry
This commit is contained in:
parent
2e21da050c
commit
17cf288e4c
1 changed files with 6 additions and 0 deletions
|
@ -33,6 +33,12 @@ module.exports = Logger =
|
|||
query: req.query
|
||||
headers: req.headers
|
||||
ip: req.ip
|
||||
# recreate error objects that have been converted to a normal object
|
||||
if !(error instanceof Error) and typeof error is "object"
|
||||
newError = new Error(error.message)
|
||||
for own key, value of error
|
||||
newError[key] = value
|
||||
error = newError
|
||||
@raven.captureError(error, {tags: tags, extra: extra})
|
||||
err: ()->
|
||||
@logger.error.apply(@logger, arguments)
|
||||
|
|
Loading…
Reference in a new issue