-
-
Save danharper/a89685cc1028759345b8 to your computer and use it in GitHub Desktop.
use Sentry (Raven) on PhoneGap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Raven.config(dsn, { | |
dataCallback(data) { | |
const normalize = filename => filename.split('/www/', 2)[1] | |
data.exception.values[0].stacktrace.frames.forEach(frame => { | |
frame.filename = normalize(frame.filename) | |
}) | |
data.culprit = data.exception.values[0].stacktrace.frames[0].filename | |
return data | |
} | |
}) |
Thanks, @danharper.
I have forked and made a little change because sometimes the filename is [native code]
and does not have the www
path, so it was appearing as undefined
in the Sentry.
You can see the changes here https://gist.github.com/ronaldozanoni/ff1c3d714c2c18219a9587b4d7cc7af8
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very helpful! Thanks!