isError()

Determines if a value is an Error object.

This function is valid in v2.1.0 to v2.24.3. This function has been downloaded 61 times.

Parameters

{*} value
Value to be tested.
{boolean=} opt_testForAnyError Optional, Default:false
Indicates whether or not any type of object whose type name ends with "Error" will count as an error object.

Returns

{boolean}
true if opt_testForAnyError is false-ish or not given and value is an Error object. true if opt_testForAnyError is true-ish and the type name of value ends with "Error". Otherwise false.

Required Function

This function directly requires the following function which is included automatically:

  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.