mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Handle reporting of cyclic objects to Sentry
This commit is contained in:
parent
032165c930
commit
c9925a3590
1 changed files with 9 additions and 1 deletions
|
@ -233,8 +233,16 @@ define [
|
||||||
start = aceDelta.start
|
start = aceDelta.start
|
||||||
if !start?
|
if !start?
|
||||||
error = new Error("aceDelta had no start event.")
|
error = new Error("aceDelta had no start event.")
|
||||||
|
JSONstringifyWithCycles = (o) ->
|
||||||
|
seen = []
|
||||||
|
return JSON.stringify o, (k,v) ->
|
||||||
|
if (typeof v == 'object')
|
||||||
|
if ( !seen.indexOf(v) )
|
||||||
|
return '__cycle__'
|
||||||
|
seen.push(v);
|
||||||
|
return v
|
||||||
Raven?.captureException(error, {
|
Raven?.captureException(error, {
|
||||||
aceDelta: JSON.stringify(aceDelta)
|
aceDelta: JSONstringifyWithCycles(aceDelta)
|
||||||
})
|
})
|
||||||
throw error
|
throw error
|
||||||
linesBefore = docLines.slice(0, start.row)
|
linesBefore = docLines.slice(0, start.row)
|
||||||
|
|
Loading…
Reference in a new issue