-
Buggy code became easier to reason about
-
Find bad ("unrecoverable") errors at the point that they occur
-
Better than nothing, but often good mostly as a memo to fix the error case
- Or if you have no idea how the code could have gone wrong
- Useful for "post-" and "pre-conditions"
-
May have to wrap in
//try
///catch
at some point -- where?- Have to remember to wrap in
//try
///catch
- Have to remember to wrap in
// try { throw new Error('hello') // } catch (e) { // console.log(e) // }