lib/error-handlers/error.js
function handleErrorClassError(err, errorMessage) {

  if (err instanceof Error) {

    extractFromErrorClass(err, errorMessage);
  } else {

    handleUnknownAsError(err, errorMessage);
  }
}
function handleErrorClassError(err, errorMessage) {

  if (err instanceof Error) {

    extractFromErrorClass(err, errorMessage);
  } else {

    handleUnknownAsError(err, errorMessage);
  }
}
function handleErrorClassError ( err , errorMessage ) { if ( err instanceof Error ) { extractFromErrorClass ( err , errorMessage ) ; } else { handleUnknownAsError ( err , errorMessage ) ; } }
Handles routing and validation for parsing an errorMessage that was
flagged as an instance of the Error class. This function does not
discriminate against regular objects, checking only to see if the err
parameter is itself a basic object and has the function property
hasOwnProperty. Given that the input passes this basic test the input
will undergo extraction by the extractFromErrorClass function, otherwise
it will be treated and processed as an unknown.
@function handleErrorClassError
@param {Error} err - the error instance to extract information from
@param {ErrorMessage} errorMessage - the error message to marshal error
information into.
@returns {Undefined} - does not return anything
Handles routing and validation for parsing an errorMessage that was flagged as an instance of the Error class . This function does not discriminate against regular objects checking only to see if the err parameter is itself a basic object and has the function property hasOwnProperty . Given that the input passes this basic test the input will undergo extraction by the extractFromErrorClass function otherwise it will be treated and processed as an unknown .