Created
March 23, 2018 22:25
-
-
Save kumavis/d94dc985d935783c201c20d879f21d3c to your computer and use it in GitHub Desktop.
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
const client = Raven.config(ravenTarget, { | |
release, | |
transport: function(opts) { | |
// modify report urls | |
const report = opts.data | |
rewriteReportUrls(report) | |
// make request normally | |
client._makeRequest(opts) | |
} | |
}) | |
client.install() | |
function rewriteReportUrls(report) { | |
// update request url | |
report.request.url = transformUrl(report.request.url) | |
// update exception stack trace | |
report.exception.values.forEach(item => { | |
item.stacktrace.frames.forEach(frame => { | |
frame.filename = transformUrl(frame.filename) | |
}) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment