Error-Type Specific try/catch Blocks

Michał Wadas michalwadas at
Fri May 27 15:13:14 UTC 2016

I still can't see why it's superior to standardizing SpiderMonkey
non-standard syntax.

try { ...
} catch(e if e instanceof Error) {


I think it's rather inferior, because your doesn't allow C#-like exception
filters. It saves you 14 characters, but limits your "easy" filters to

To quote article on C# exception filters:

> For example, let’s say you are writing code to perform some operation
against a dependency, and that dependency will throw an exception with a
*bool* property that tells you whether the operation *IsRetryable*.
> Now, let’s say that as we’re calling this dependency, we want to be able
to retry any error that has *IsRetryable == true* up to three times, then
abandon if it throws a fourth time.

I think it's legitimate use case and why can't we kill two birds with one
stone? Moreover, I think it's bad idea to add static typing to language in
only one place (catch clauses).

On Fri, May 27, 2016 at 11:05 AM, Arthur Stolyar <nekr.fabula at>

> Something wrong with prev link.
> On May 27, 2016 12:00, "Arthur Stolyar" <nekr.fabula at> wrote:
>> If something, here seems to be another similar proposal:
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list