chore: do not print full stack traces for connection errors
MODIFY
lib/jsonwp-proxy/proxy.js
lib/jsonwp-proxy/proxy.js
@@ -16,6 +16,7 @@ import https from 'https';
const log = logger.getLogger('WD Proxy');
const DEFAULT_REQUEST_TIMEOUT = 240000;
+const COMPACT_ERROR_PATTERNS = [/\bECONNREFUSED\b/];
const {MJSONWP, W3C} = PROTOCOLS;
@@ -213,8 +214,11 @@ class JWProxy {
}
} else {
proxyErrorMsg = `Could not proxy command to the remote server. Original error: ${e.message}`;
- log.warn(e.message);
- log.debug(e.stack);
+ if (COMPACT_ERROR_PATTERNS.some((p) => p.test(e.message))) {
+ log.info(e.message);
+ } else {
+ log.info(e.stack);
+ }
}
throw new errors.ProxyRequestError(proxyErrorMsg, e.response?.data, e.response?.status);
}

chore: do not print full stack traces for connection errors (#412)