Merge pull request #91 from strongloop/fix/message

Reword log messages for better clarity
This commit is contained in:
Miroslav Bajtoš 2020-10-13 09:49:36 +02:00 committed by GitHub
commit a24f9aa694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -14,11 +14,15 @@ In debug mode, `strong-error-handler` returns full error stack traces and intern
## Supported versions
| Current | Long Term Support | Maintenance |
| :-----: | :---------------: | :---------: |
| 4.x | 3.x | 2.x |
This module adopts the [Module Long Term Support (LTS)](http://github.com/CloudNativeJS/ModuleLTS) policy, with the following End Of Life (EOL) dates:
Learn more about our LTS plan in [docs](http://loopback.io/doc/en/contrib/Long-term-support.html).
| Version | Status | Published | EOL |
| ---------- | --------------- | --------- | -------------------- |
| 4.x | Current | Oct 2020 | Apr 2023 _(minimum)_ |
| 3.x | Active LTS | Jun 2018 | Dec 2022 |
| 2.x | End-of-life | Mar 2017 | Oct 2020 |
Learn more about our LTS plan in the [LoopBack documentation](http://loopback.io/doc/en/contrib/Long-term-support.html).
## Installation

View File

@ -10,12 +10,12 @@ const g = require('strong-globalize')();
module.exports = function logToConsole(req, err) {
if (!Array.isArray(err)) {
g.error('Unhandled error for request %s %s: %s',
g.error('Request %s %s failed: %s',
req.method, req.url, err.stack || err);
return;
}
const errMsg = g.f('Unhandled array of errors for request %s %s\n',
const errMsg = g.f('Request %s %s failed with multiple errors:\n',
req.method, req.url);
const errors = err.map(formatError).join('\n');
console.error(errMsg, errors);

View File

@ -2,7 +2,7 @@
"name": "strong-error-handler",
"description": "Error handler for use in development and production environments.",
"license": "MIT",
"version": "3.5.0",
"version": "4.0.0-1",
"engines": {
"node": ">=10"
},