Skip to main content

ExceptionCondition 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

Exception at Runtime

Logical Error

Non-exception Failures & bug from bad Semantic in Source Code

References

  1. Runtime ErrorException at Runtime

  2. throwJS Keyword Statement to stop executing current function with user-defined Exception

  3. Exception Handling ↔ (process) to respond to Exception

  4. Non-exception FailuresUnexpected behavior which doesn't throw Exception (in default JavaScript)

  5. ReferenceErrorException due to illegal reference Identifier

  6. --noImplicitAny ↔ to flag TSC to prevent Type Inference for any - enforce explicit Type for Parameter, Exception, etc

  7. Error Boundary ↔ fallback mechanism for to handle Exception in child component

  8. assert.throws()assert Static Method to complain if Callback Function Parameter does not throw Exception

  9. "noImplicitAny": true ↔ to throw Exception when any Parameter inferred as any

  10. "strictNullChecks": true ↔ to throw Exception when access Variable which potentially be null/undefined

  11. RangeErrorException when number || Param outside valid range

  12. InternalErrorException when exceed Call Stack size in JS Engine - when something too large || Infinite Loop

  13. TypeErrorException when can not perform operation due to unexpected Type

  14. URIErrorException when URI Handler (encodeURI() || decodeURI()) pass incorect args