Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "error/to-json/docs/types/index.d"

Index

Functions

Functions

toJSON

  • toJSON(err: Error | TypeError | SyntaxError | URIError | ReferenceError | RangeError | EvalError): any
  • Returns a JSON representation of an error object.

    Parameters

    • err: Error | TypeError | SyntaxError | URIError | ReferenceError | RangeError | EvalError

      error to serialize

    Returns any

    JSON representation

    Example

    var err = new Error( 'beep' );
    var json = toJSON( err );
    // returns {...}