w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
682 stars 195 forks source link

Support protocol extension of errors #1151

Open InstyleVII opened 6 years ago

InstyleVII commented 6 years ago

We currently allow protocol extensions for both capabilities and commands, but not for errors. As we're encouraging different working groups to create their own custom endpoints/capabilities (as well as allowing user agents to define their own) it only makes sense to also allow them to define their own errors for those custom endpoints (vendor specific or working group specific).

andreastt commented 6 years ago

A data point is that geckodriver currently (mis)uses the unknown error code when failing to install addons through the extension command /session/{session id}/moz/addon/install.

InstyleVII commented 6 years ago

Yeah I think that's a poor solution for developers that we should address via allowing extension errors. We use unknown error as well for some of our vendor-specific errors (or the closest webdriver equivalent) but it would be nice if we could be more specific.

jugglinmike commented 6 years ago

In the "Automation" section of the Permissions API, we worked around this by using (maybe over-using) the generic "invalid argument" error. As more web APIs introduce automation sections of their own, we'll either see a profusion of these generic error responses or new error codes introduced in an ad-hoc way. The latter is under consideration in the Generic Sensors API.