Home

function: isError


isError(value: *): boolean

Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, `SyntaxError`, `TypeError`, or `URIError` object.

Example(s):

isError(new Error)
// => true

isError(Error)
// => false

Params:

Name Type Attribute Description
value The value to check.

Returns:

boolean

  {
    "comment": "/**\r\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\r\n * `SyntaxError`, `TypeError`, or `URIError` object.\r\n *\r\n * @since 3.0.0\r\n * @category Lang\r\n * @param {*} value The value to check.\r\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\r\n * @example\r\n *\r\n * isError(new Error)\r\n * // => true\r\n *\r\n * isError(Error)\r\n * // => false\r\n */",
    "meta": {
        "range": [
            552,
            836
        ],
        "filename": "isError.js",
        "lineno": 21,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100004663",
            "name": "isError",
            "type": "FunctionDeclaration",
            "paramnames": [
                "value"
            ]
        },
        "vars": {
            "tag": "isError~tag"
        }
    },
    "description": "Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\r`SyntaxError`, `TypeError`, or `URIError` object.",
    "since": "3.0.0",
    "tags": [
        {
            "originalTitle": "category",
            "title": "category",
            "text": "Lang",
            "value": "Lang"
        }
    ],
    "params": [
        {
            "type": {
                "names": [
                    "*"
                ]
            },
            "description": "The value to check.",
            "name": "value"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "boolean"
                ]
            },
            "description": "Returns `true` if `value` is an error object, else `false`."
        }
    ],
    "examples": [
        "isError(new Error)\r// => true\r\risError(Error)\r// => false"
    ],
    "name": "isError",
    "longname": "isError",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000451",
    "___s": true,
    "filepath": "isError.js"
}