fix: Do not print stack for request errors
MODIFY
lib/jsonwp-proxy/proxy.js
lib/jsonwp-proxy/proxy.js
@@ -219,13 +219,12 @@ class JWProxy {
log.warn(e.message);
log.debug(e.stack);
} else {
- if (!(_.isPlainObject(e.error) || /^\s*\{/.test(e.error))) {
+ if (!util.hasValue(e.statusCode) || !/^\s*\{/.test(e.error)) {
if (isResponseLogged) {
- log.warn('The response has an unknown format');
+ log.info('The response has an unknown format');
} else {
- log.warn(`Got an unexpected response with status ${e.statusCode}: ${truncateBody(e.error)}`);
+ log.info(`Got an unexpected response with status ${e.statusCode}: ${truncateBody(e.error)}`);
}
- log.debug(e.stack);
} else if (!isResponseLogged) {
log.debug(`Got response with status ${e.statusCode}: ${truncateBody(e.error)}`);
isResponseLogged = true;

fix: Do not print stack for request errors (#352)