Bug 1460229 - Throw an explicit error message when a method specified in a spec is missing in the actor. r=jryans
MozReview-Commit-ID: JdsCMh93xZE
--- a/devtools/shared/protocol.js
+++ b/devtools/shared/protocol.js
@@ -1146,16 +1146,20 @@ var generateRequestHandlers = function(a
let args;
try {
args = spec.request.read(packet, this);
} catch (ex) {
console.error("Error reading request: " + packet.type);
throw ex;
}
+ if (!this[spec.name]) {
+ throw new Error(`Spec for '${actorProto.typeName}' specifies a '${spec.name}'` +
+ ` method that isn't implemented by the actor`);
+ }
let ret = this[spec.name].apply(this, args);
let sendReturn = (retToSend) => {
if (spec.oneway) {
// No need to send a response.
return;
}