Please enable JavaScript.
Coggle requires JavaScript to display documents.
JavaScript Error Handling - Coggle Diagram
JavaScript Error Handling
Error Object
what is it
a JavaScript object
has "stack", "errorCode", etc
when to use
making exception
we want consumer/other code to handle it
types
Error
TypeError
Exception
what is it
a "throw"n Error
characteristics
keep going down the stack of program
until it is being caught /
catch
Catching Exception
synchronous
try catch to catch
throw to throw exception
asynchornous
promises
promise.reject to throw
Promise().catch() to catch
async await
throw to throw exception
try catch to catch
Introduction
what is it
error
throwing exception
other library throws exception
which they cannot catch/handle their own
they give us choice to handle it ourself
handling
what to do with the error
why care
clean program
clear feedback
library making
throw your own exception for consumers