Exception
↔ Condition to interrupt code execution
aka Error
Exception Handling
(process) to respond to Exception
Error
Constructor for generic Error Object
EvalError
InternalError
Exception when exceed Call Stack size in JS Engine - when something too large || Infinite Loop
RangeError
Exception when number
|| Param outside valid range
ReferenceError
Exception due to illegal reference Identifier
SyntaxError
Exception due to incorrect JS Syntax, will throw at Parsing/Compilation phase of Source Code
TypeError
Exception when can not perform operation due to unexpected Type
URIError
Exception when URI Handler (encodeURI()
|| decodeURI()
) pass incorect args
Runtime Error
Logical Error
Non-exception Failures & bug from bad Semantic in Source Code
References
throw
↔ JS Keyword Statement to stop executing current function with user-defined ExceptionException Handling
↔ (process) to respond to ExceptionNon-exception Failures
↔ Unexpected behavior which doesn't throw Exception (in default JavaScript)ReferenceError
↔ Exception due to illegal reference Identifier--noImplicitAny
↔ to flag TSC to prevent Type Inference forany
- enforce explicit Type for Parameter, Exception, etcError Boundary
↔ fallback mechanism for to handle Exception in child componentassert.throws()
↔assert
Static Method to complain if Callback Function Parameter does not throw Exception"noImplicitAny": true
↔ tothrow
Exception when any Parameter inferred asany
"strictNullChecks": true
↔ tothrow
Exception when access Variable which potentially benull
/undefined
RangeError
↔ Exception whennumber
|| Param outside valid rangeInternalError
↔ Exception when exceed Call Stack size in JS Engine - when something too large || Infinite LoopTypeError
↔ Exception when can not perform operation due to unexpected TypeURIError
↔ Exception when URI Handler (encodeURI()
||decodeURI()
) pass incorect args