-
-
Save ronaldozanoni/ff1c3d714c2c18219a9587b4d7cc7af8 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: function(data) { | |
var normalize = function(filename) { | |
// sometimes the filename is [native code] | |
if (filename.indexOf('/www/') !== -1) { | |
return '~/' + filename.split('/www/', 2)[1]; | |
} | |
return filename; | |
}; | |
var frames = data.exception.values[0].stacktrace.frames; | |
for (var index = 0, len = frames.length; index < len; index++) { | |
var frame = frames[index]; | |
frame.filename = normalize(frame.filename); | |
} | |
data.culprit = frames[0].filename; | |
return data; | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment