Clean up error message from protocol
MODIFY
lib/protocol/protocol.js
lib/protocol/protocol.js
@@ -360,7 +360,13 @@ function buildHandler (app, method, path, spec, driver, isSessCmd) {
// Use the logger that's specific to this response
const protocolLogger = isW3C ? w3cLog : mjsonwpLog;
- protocolLogger.error(`Encountered internal error running command: ${JSON.stringify(err)} ${err.stacktrace || err.stack}`);
+ let errMsg = err.stacktrace || err.stack;
+ if (!errMsg.includes(err.message)) {
+ // if the message has more information, add it. but often the message
+ // is the first part of the stack trace
+ errMsg = `${err.message} ${errMsg}`;
+ }
+ protocolLogger.error(`Encountered internal error running command: ${errMsg}`);
if (isErrorType(err, errors.ProxyRequestError)) {
actualErr = err.getActualError();
}

Clean up error message from protocol (#249)