Skip to content

Instantly share code, notes, and snippets.

@kumavis
Created March 23, 2018 22:25
Show Gist options
  • Save kumavis/d94dc985d935783c201c20d879f21d3c to your computer and use it in GitHub Desktop.
Save kumavis/d94dc985d935783c201c20d879f21d3c to your computer and use it in GitHub Desktop.
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