dreamstack/engine/ds-screencast/node_modules/chrome-remote-interface/lib/errors.js

16 lines
400 B
JavaScript

'use strict';
class ProtocolError extends Error {
constructor(request, response) {
let {message} = response;
if (response.data) {
message += ` (${response.data})`;
}
super(message);
// attach the original response as well
this.request = request;
this.response = response;
}
}
module.exports.ProtocolError = ProtocolError;