Closed Bug 1460229 Opened 2 years ago Closed 2 years ago

Protocol.js doesn't throw an explicit error when a method is specified in spec but not implement in the actor

Categories

(DevTools :: Framework, enhancement, P3)

enhancement

Tracking

(firefox62 fixed)

RESOLVED FIXED
Firefox 62
Tracking Status
firefox62 --- fixed

People

(Reporter: ochameau, Assigned: ochameau)

References

(Blocks 1 open bug)

Details

(Whiteboard: dt-fission)

Attachments

(1 file)

I saw that while working in bug 1449162. It would be great to replace the cryptic exception happening within protocol.js by an explicit error message.
Severity: normal → enhancement
Priority: -- → P3
Assignee: nobody → poirot.alex
Comment on attachment 8974317 [details]
Bug 1460229 - Throw an explicit error message when a method specified in a spec is missing in the actor.

https://reviewboard.mozilla.org/r/242634/#review250088

Great, this seems like a helpful improvement! :)

::: devtools/shared/protocol.js:1155
(Diff revision 1)
>            console.error("Error reading request: " + packet.type);
>            throw ex;
>          }
>  
> +        if (!this[spec.name]) {
> +          throw new Error(`Spec for '${actorProto.typeName}' specify a '${spec.name}' ` +

Nit: specify -> specifies
Attachment #8974317 - Flags: review?(jryans) → review+
Pushed by apoirot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ac313bdb1bff
Throw an explicit error message when a method specified in a spec is missing in the actor. r=jryans
https://hg.mozilla.org/mozilla-central/rev/ac313bdb1bff
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 62
Blocks: dt-pjs
Product: Firefox → DevTools
Whiteboard: dt-fission
You need to log in before you can comment on or make changes to this bug.