Error Objects
ECMAScript v3 defines a
number
of classes that represent errors. The JavaScript interpreter
“throws” an object of one of these types when a runtime
error occurs. (See the throw
and
try
statements in Chapter 6 for
a discussion of throwing and catching errors.) Each error object has
a message
property that contains an implementation-specific error message. The
types of predefined error objects are Error, EvalError, RangeError,
ReferenceError, SyntaxError, TypeError, and URIError. You can find
out more about these classes in the core reference section of this
book.
Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.