Hi All
Please excuse the newbie question
We’re using a custom login script to authenticate using a Node.js aggregator service
In our code we are checking for the existence of an ‘errors’ element in the response with contains the error code from the underlying service:
if (err || (JSON.parse(body).errors && JSON.parse(body).errors.length)) {
return callback(new Error(), null);
}
For the constructor new Error() , is there a method that takes, say the error code and error message
e.g. new Error(500, “Oops something went wrong”)
or can you throw a different type of Error object (Which affects the error message displayed to the user on the Universal login)?
e.g. return callback(new UnauthorisedError(), null);
return callback(new SystemError(), null);
Kind regards
Richard