Re: Some changes to how errors are thrown from Web IDL methods

2020-02-14 Thread Anne van Kesteren
On Thu, Feb 6, 2020 at 3:12 PM Boris Zbarsky wrote: > I would really like to get to the point where when web developers see > errors in their console they don't have to guess what caused those > errors, and having meaningful messages is the simplest way to get there. This is a great goal and we

Re: Some changes to how errors are thrown from Web IDL methods

2020-02-14 Thread Boris Zbarsky
On 2/11/20 8:57 AM, Anne van Kesteren wrote: I don't know how much work this is, but ideally the signature is something like throwType(safeMessage, consoleMessage), whereby consoleMessage defaults to safeMessage or some such. We can certainly do that. It's "some" work for DOMException:

Re: Some changes to how errors are thrown from Web IDL methods

2020-02-14 Thread Boris Zbarsky
On 2/7/20 10:13 AM, Nathan Froyd wrote: If you have other things you'd like this static analysis to be used for, please file dependencies on bug 1613440. Nice! I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1614548 -Boris ___ dev-platform

Re: Some changes to how errors are thrown from Web IDL methods

2020-02-10 Thread Nathan Froyd
On Thu, Feb 6, 2020 at 9:12 AM Boris Zbarsky wrote: > 3) While ErrorResult::Throw taking just an nsresult still exists, it is > deprecated and new code should not be adding new calls to it if that can > be avoided. > We are attempting to add a static analysis that blocks new uses of

Some changes to how errors are thrown from Web IDL methods

2020-02-06 Thread Boris Zbarsky
Hello all, I just checked in some improvements to how we report exceptions on ErrorResult and in promise rejections [1]. Summary: 1) The public ThrowDOMException method that takes an nsresult and a string is gone. Instead, there are methods like ThrowIndexSizeError,