@pager/hapi-raven
Advanced tools
Comparing version 6.0.0-hapi17-rc.1 to 6.0.0-hapi17-rc.2
@@ -22,27 +22,34 @@ 'use strict'; | ||
server.expose('raven', Raven); | ||
server.events.on('request', (request, err) => { | ||
/* $lab:coverage:off$ */ | ||
const baseUrl = request.info.uri || | ||
server.events.on('request', (request, event, tags) => { | ||
if (event.channel === 'error') { | ||
/* $lab:coverage:off$ */ | ||
const baseUrl = request.info.uri || | ||
request.info.host && `${server.info.protocol}://${request.info.host}` || | ||
server.info.uri; | ||
/* $lab:coverage:on$ */ | ||
/* $lab:coverage:on$ */ | ||
Raven.captureException(err, { | ||
request: { | ||
method: request.method, | ||
query_string: request.query, | ||
headers: request.headers, | ||
cookies: request.state, | ||
url: `${baseUrl}${request.path}` | ||
}, | ||
extra: { | ||
timestamp: request.info.received, | ||
id: request.id, | ||
remoteAddress: request.info.remoteAddress | ||
}, | ||
tags: options.tags | ||
}); | ||
Raven.captureException(event.error, { | ||
request: { | ||
method: request.method, | ||
query_string: request.query, | ||
headers: request.headers, | ||
cookies: request.state, | ||
url: `${baseUrl}${request.path}` | ||
}, | ||
extra: { | ||
timestamp: request.info.received, | ||
id: event.request, | ||
remoteAddress: request.info.remoteAddress | ||
}, | ||
tags: event.tags | ||
}); | ||
} | ||
}); | ||
} | ||
}; |
{ | ||
"name": "@pager/hapi-raven", | ||
"version": "6.0.0-hapi17-rc.1", | ||
"version": "6.0.0-hapi17-rc.2", | ||
"description": "A Hapi plugin for sending exceptions to Sentry through Raven", | ||
@@ -5,0 +5,0 @@ "main": "./lib", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6596
41