Skip to content

Commit 4264b85

Browse files
committed
bump deps and hapi 18
1 parent 337c0ab commit 4264b85

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

lib/error-handler.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ class ErrorHandler {
221221
title: error.output.payload.error,
222222
message: error.message,
223223
statusCode: error.output.statusCode,
224-
url: request.url.path,
224+
url: request.path,
225225
method: request.raw.req.method,
226226
headers: request.raw.req.headers,
227227
payload: request.raw.req.method !== 'GET' ? request.payload : '',
@@ -239,10 +239,9 @@ class ErrorHandler {
239239
*/
240240
sendJson (request, h) {
241241
const error = this.composeError(request)
242-
const json = this.resolveJson(error)
243242

244243
return h
245-
.response(json)
244+
.response(this.resolveJson(error))
246245
.type('application/json')
247246
.code(error.statusCode)
248247
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
"devDependencies": {
1414
"boom": "~7.3.0",
1515
"code": "~5.2.4",
16-
"eslint": "~5.11.1",
16+
"eslint": "~5.12.1",
1717
"eslint-config-standard": "~12.0.0",
1818
"eslint-plugin-import": "~2.14.0",
19-
"eslint-plugin-node": "~8.0.0",
19+
"eslint-plugin-node": "~8.0.1",
2020
"eslint-plugin-promise": "~4.0.1",
2121
"eslint-plugin-standard": "~4.0.0",
22-
"hapi": "~17.8.1",
22+
"hapi": "~18.0.0",
2323
"husky": "~1.3.1",
2424
"joi": "~14.3.1",
2525
"lab": "~18.0.1",
2626
"sinon": "~7.2.2",
2727
"vision": "~5.4.4"
2828
},
2929
"engines": {
30-
"node": ">=8.0.0"
30+
"node": ">=8"
3131
},
3232
"homepage": "https://github.com/fs-opensource/hapi-dev-errors#readme",
3333
"keywords": [

test/plugin-is-enabled-when-not-in-production.js

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ experiment('hapi-dev-error register plugin', () => {
3030
const routeOptions = {
3131
path: '/showErrorsForWeb',
3232
method: 'GET',
33-
handler: () => {
34-
return Boom.badImplementation('a fancy server error')
35-
}
36-
}
33+
handler: () => Boom.badImplementation('a fancy server error') }
3734

3835
server.route(routeOptions)
3936

@@ -81,9 +78,7 @@ experiment('hapi-dev-error register plugin', () => {
8178
const routeOptions = {
8279
path: '/showPromiseError',
8380
method: 'GET',
84-
handler: () => {
85-
return Promise.reject(new Error('server error'))
86-
}
81+
handler: () => new Error('server error')
8782
}
8883

8984
server.route(routeOptions)
@@ -109,9 +104,7 @@ experiment('hapi-dev-error register plugin', () => {
109104
const routeOptions = {
110105
path: '/with-request-payload',
111106
method: 'POST',
112-
handler: () => {
113-
return Promise.reject(new Error('server error with payload'))
114-
}
107+
handler: () => new Error('server error with payload')
115108
}
116109

117110
server.route(routeOptions)

0 commit comments

Comments
 (0)