Filtered Promise#catch

Michał Wadas michalwadas at
Wed Oct 11 23:38:23 UTC 2017

It's possible to standardize already existing filtered catch from

try {
   throw new Error('42');
} catch(e if e.message === 42) {


Then Promise.prototype.catch extension can work in very similar manner - by
predicate function and user code can easily adopt pattern-matching in
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list