Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 531 Bytes

009.md

File metadata and controls

18 lines (15 loc) · 531 Bytes

"Throwing" reflections

  • 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

// try { throw new Error('hello') // } catch (e) { // console.log(e) // }