@feathersjs/errors
Advanced tools
Comparing version 3.1.0 to 3.2.0
# Change Log | ||
## [v3.1.0](https://github.com/feathersjs/errors/tree/v3.1.0) (2017-11-18) | ||
[Full Changelog](https://github.com/feathersjs/errors/compare/v3.0.0...v3.1.0) | ||
**Closed issues:** | ||
- feature: allow for mixed files/functions for error-handler options [\#91](https://github.com/feathersjs/errors/issues/91) | ||
**Merged pull requests:** | ||
- 91 allow mixed config [\#94](https://github.com/feathersjs/errors/pull/94) ([DesignByOnyx](https://github.com/DesignByOnyx)) | ||
## [v3.0.0](https://github.com/feathersjs/errors/tree/v3.0.0) (2017-11-01) | ||
@@ -4,0 +15,0 @@ [Full Changelog](https://github.com/feathersjs/errors/compare/v3.0.0-pre.1...v3.0.0) |
@@ -5,3 +5,4 @@ const path = require('path'); | ||
const defaults = { | ||
public: path.resolve(__dirname, 'public') | ||
public: path.resolve(__dirname, 'public'), | ||
logger: console | ||
}; | ||
@@ -26,2 +27,7 @@ const defaultHtmlError = path.resolve(defaults.public, 'default.html'); | ||
return function (error, req, res, next) { | ||
// Log the error if it didn't come from a service method call | ||
if (options.logger && typeof options.logger.error === 'function' && !res.hook) { | ||
options.logger.error(error); | ||
} | ||
if (error.type !== 'FeathersError') { | ||
@@ -96,3 +102,3 @@ let oldError = error; | ||
} else if (options.html && (contentType.indexOf('html') !== -1 || accepts.indexOf('html') !== -1)) { | ||
return formatter['text/html'](error, req, res, next); | ||
formatter['text/html'](error, req, res, next); | ||
} else { | ||
@@ -99,0 +105,0 @@ // TODO (EK): Maybe just return plain text |
{ | ||
"name": "@feathersjs/errors", | ||
"description": "Common error types for feathers apps", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"homepage": "https://github.com/feathersjs/errors", | ||
@@ -6,0 +6,0 @@ "main": "lib/index", |
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
68751
293