@pager/hapi-raven
Advanced tools
Comparing version 5.2.5 to 5.3.0
@@ -8,29 +8,31 @@ 'use strict'; | ||
const dsn = options.dsn; | ||
const client = new Raven.Client(dsn, options.client); | ||
Raven.config(options.dsn, options.client); | ||
if (dsn && options.patchGlobal) { | ||
client.patchGlobal((err) => { | ||
/* $lab:coverage:off$ */ | ||
console.error(err); | ||
process.exit(1); | ||
/* $lab:coverage:on$ */ | ||
}); | ||
if (options.patchGlobal) { | ||
Raven.install(); | ||
} | ||
server.expose('raven', client); | ||
server.expose('raven', Raven); | ||
server.on('request-error', (request, err) => { | ||
client.captureError(err, { | ||
/* $lab:coverage:off$ */ | ||
const baseUrl = request.info.uri || | ||
request.info.host && `${server.info.protocol}://${request.info.host}` || | ||
server.info.uri; | ||
/* $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, | ||
method: request.method, | ||
path: request.path, | ||
query: request.query, | ||
remoteAddress: request.info.remoteAddress, | ||
userAgent: request.raw.req.headers['user-agent'] | ||
} | ||
remoteAddress: request.info.remoteAddress | ||
}, | ||
tags: options.tags | ||
}); | ||
@@ -37,0 +39,0 @@ }); |
{ | ||
"name": "@pager/hapi-raven", | ||
"version": "5.2.5", | ||
"version": "5.3.0", | ||
"description": "A Hapi plugin for sending exceptions to Sentry through Raven", | ||
@@ -18,10 +18,8 @@ "main": "./lib", | ||
"dependencies": { | ||
"raven": "0.x.x" | ||
"raven": "1.x.x" | ||
}, | ||
"devDependencies": { | ||
"boom": "4.x.x", | ||
"code": "3.x.x", | ||
"hapi": "15.x.x", | ||
"lab": "11.x.x", | ||
"sinon": "1" | ||
"code": "4.x.x", | ||
"hapi": "16.x.x", | ||
"lab": "11.x.x" | ||
}, | ||
@@ -28,0 +26,0 @@ "keywords": [ |
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
6160
3
36
+ Addedraven@1.2.1(transitive)
- Removedraven@0.12.3(transitive)
Updatedraven@1.x.x