Skip to content

Commit

Permalink
connection: log the protocol error data field (#2645)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish authored Jul 7, 2017
1 parent 9561330 commit d587357
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lighthouse-core/gather/connections/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class Connection {
if (object.error) {
const logLevel = callback.options && callback.options.silent ? 'verbose' : 'error';
log.formatProtocol('method <= browser ERR', {method: callback.method}, logLevel);
throw new Error(`Protocol error (${callback.method}): ${object.error.message}`);
let errMsg = `(${callback.method}): ${object.error.message}`;
if (object.error.data) errMsg += ` (${object.error.data})`;
throw new Error(`Protocol error ${errMsg}`);
}

log.formatProtocol('method <= browser OK',
Expand Down

0 comments on commit d587357

Please sign in to comment.