hapi-dev-errors
Advanced tools
Comparing version 3.2.5 to 3.2.6
# Changelog | ||
## Version [3.2.6](https://github.com/futurestudio/hapi-dev-errors/compare/v3.2.5...v3.2.6) (2019-10-26) | ||
### Updated | ||
- refine Readme | ||
- bump dependencies | ||
- remove Node.js v11 from Travis testing | ||
- minor refactorings (a mobile app update would say: βperformance improvementsβ) | ||
## Version [3.2.5](https://github.com/futurestudio/hapi-dev-errors/compare/v3.2.4...v3.2.5) (2019-05-19) | ||
### Updated | ||
- fix `.travis.yml` to properly test the hapi version matrix | ||
- fix `@hapi/hapi` import in examples | ||
@@ -7,0 +17,0 @@ - minor example refinements |
@@ -131,3 +131,5 @@ 'use strict' | ||
async resolveError (request, h) { | ||
await this.logToTerminal(request) | ||
if (this.shouldLogToTerminal()) { | ||
await this.logToTerminal(request) | ||
} | ||
@@ -146,2 +148,12 @@ if (this.wantsJson(request)) { | ||
/** | ||
* Returns a boolean whether to log | ||
* the error to the terminal. | ||
* | ||
* @returns {Boolean} | ||
*/ | ||
shouldLogToTerminal () { | ||
return this.toTerminal | ||
} | ||
/** | ||
* Logs the error to terminal. | ||
@@ -152,8 +164,6 @@ * | ||
async logToTerminal (request) { | ||
if (this.toTerminal) { | ||
const youch = this.createYouch(request) | ||
const json = await youch.toJSON() | ||
const youch = this.createYouch(request) | ||
const json = await youch.toJSON() | ||
console.log(ForTerminal(json)) | ||
} | ||
console.log(ForTerminal(json)) | ||
} | ||
@@ -160,0 +170,0 @@ |
{ | ||
"name": "hapi-dev-errors", | ||
"description": "Return better error details and skip the look at command line to catch the issue.", | ||
"version": "3.2.5", | ||
"version": "3.2.6", | ||
"author": "Future Studio <info@futurestud.io>", | ||
@@ -20,16 +20,16 @@ "bugs": { | ||
"devDependencies": { | ||
"@hapi/boom": "~7.4.2", | ||
"@hapi/code": "~5.3.1", | ||
"@hapi/hapi": "~18.3.1", | ||
"@hapi/joi": "~15.0.3", | ||
"@hapi/lab": "~19.0.1", | ||
"@hapi/vision": "~5.5.2", | ||
"eslint": "~5.16.0", | ||
"eslint-config-standard": "~12.0.0", | ||
"eslint-plugin-import": "~2.17.2", | ||
"eslint-plugin-node": "~9.0.1", | ||
"eslint-plugin-promise": "~4.1.1", | ||
"eslint-plugin-standard": "~4.0.0", | ||
"husky": "~2.3.0", | ||
"sinon": "~7.3.2" | ||
"@hapi/boom": "~8.0.0", | ||
"@hapi/code": "~6.0.0", | ||
"@hapi/hapi": "~18.4.0", | ||
"@hapi/joi": "~15.1.1", | ||
"@hapi/lab": "~20.4.0", | ||
"@hapi/vision": "~5.5.4", | ||
"eslint": "~6.5.0", | ||
"eslint-config-standard": "~14.1.0", | ||
"eslint-plugin-import": "~2.18.2", | ||
"eslint-plugin-node": "~10.0.0", | ||
"eslint-plugin-promise": "~4.2.1", | ||
"eslint-plugin-standard": "~4.0.1", | ||
"husky": "~3.0.5", | ||
"sinon": "~7.5.0" | ||
}, | ||
@@ -56,2 +56,4 @@ "engines": { | ||
"scripts": { | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"test": "lab --assert @hapi/code --leaks --coverage --lint", | ||
@@ -58,0 +60,0 @@ "prepush": "npm test" |
@@ -20,3 +20,3 @@ <div align="center"> | ||
<a href="https://www.npmjs.com/package/hapi-dev-errors"><img src="https://img.shields.io/npm/v/hapi-dev-errors.svg" alt="Latest Version"></a> | ||
<a href="https://www.npmjs.com/package/hapi-dev-errors"><img src="https://img.shields.io/npm/dt/hapi-dev-errors.svg" alt="Total downloads"></a> | ||
<a href="https://www.npmjs.com/package/hapi-dev-errors"><img src="https://img.shields.io/npm/dm/hapi-dev-errors.svg" alt="Total downloads"></a> | ||
<a href="https://greenkeeper.io/" rel="nofollow"><img src="https://badges.greenkeeper.io/futurestudio/hapi-dev-errors.svg" alt="Greenkeeper badge" data-canonical-src="https://badges.greenkeeper.io/futurestudio/hapi-dev-errors.svg" style="max-width:100%;"></a> | ||
@@ -59,7 +59,3 @@ </p> | ||
```bash | ||
# NPM 5: this way is yours | ||
npm i hapi-dev-errors | ||
# NPM 4: | ||
npm i -S hapi-dev-errors | ||
``` | ||
@@ -72,7 +68,3 @@ | ||
```bash | ||
# NPM 5: this way is yours | ||
npm i hapi-dev-errors@1.3.2 | ||
# NPM 4: use NPM shortcuts to (i)nstall and (-S)ave the module as a dependency | ||
npm i -S hapi-dev-errors@1.3.2 | ||
``` | ||
@@ -124,3 +116,4 @@ | ||
Search hapi-dev-errors on GitHub | ||
</a>` | ||
</a> | ||
` | ||
} | ||
@@ -127,0 +120,0 @@ ] |
@@ -33,3 +33,4 @@ 'use strict' | ||
method: 'GET', | ||
handler: () => Boom.badImplementation('a fancy server error') } | ||
handler: () => Boom.badImplementation('a fancy server error') | ||
} | ||
@@ -36,0 +37,0 @@ server.route(routeOptions) |
@@ -57,3 +57,3 @@ 'use strict' | ||
it('throws if the links are strings', async () => { | ||
const server = await createServer({ links: [ 'error' ] }) | ||
const server = await createServer({ links: ['error'] }) | ||
@@ -88,3 +88,3 @@ const response = await server.inject({ | ||
it('works fine with a link function', async () => { | ||
const server = await createServer({ links: () => `link` }) | ||
const server = await createServer({ links: () => 'link' }) | ||
@@ -91,0 +91,0 @@ const response = await server.inject({ |
Sorry, the diff of this file is not supported yet
226244
910
174