Just try

Michael McGlothlin mike.mcglothlin at gmail.com
Fri Oct 30 13:48:21 UTC 2015


It'd be nice if you could just do try {} without all the catch and finally
stuff because about half the time the logic is simpler if I can just put
all the error handling code in one place at the end. I end up with a lot of
empty catch (err){} laying around waiting to break something. And using one
large try/catch/finally block isn't really workable either because I don't
want an exception to break the flow.

Of course it'd be nice if there was syntax to shorten

let test = undefined;
try {
 test = testSomething();
} catch ( err ) {}

into just

let test = try testSomething() || undefined;

Possibly where without the `|| undefined` test would contain an Error
instance that's flagged as thrown or such. An Error flagged as thrown
should evaluate as false so that logic ops work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151030/f0194fbf/attachment.html>


More information about the es-discuss mailing list