w3c / webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Other
576 stars 50 forks source link

Error and warning codes for extensions (manifest declaration and API usage) #633

Closed solomonkinard closed 1 week ago

solomonkinard commented 3 weeks ago

Adding error / warning codes for extensions would make it possible for extension developers to find their code into the distant future even if the message itself has changed.

This could be enabled for manifest declaration and API usage.

A con is that it could be a lot of work for maybe little benefit.

What are your ideas, and any pros and cons to share?

solomonkinard commented 3 weeks ago

I'm not necessarily advocating for using the same error code across different browsers. But if someone wants to champion that, please share pros and cons.

Rob--W commented 3 weeks ago

I mainly see advantages if it is possible for browsers to share a common set of error codes. Otherwise it would be browser-specific and extension authors may as well just check the error message strings themselves.

carlosjeurissen commented 3 weeks ago

Very much in favour of at least addressing some of the inconsistencies when it comes to error messages as even an error message of a missing property in a specific API call can differ across browsers. However in the given example an error / warning code would still need to be accompanied by some additional data like in this case the missing property.

solomonkinard commented 1 week ago

Thanks. Those sound like reasonable ideas. I don't personally plan on championing this right now for cross-browsers. But anyone can run with this at any time if they're interested. In order to move forward, someone else would need to do at least the following:

  1. deciding what format to show in the UI
  2. document one or more codes in common
  3. put documentation in version control