ServerError¶
The authorization server encountered an unexpected condition that prevented it from fulfilling the request. See Section 4.1.2.1 of RFC 6749.
const ServerError = require('oauth2-server/lib/errors/server-error');
ServerError
is used to wrap unknown exceptions encountered during request processing.
new ServerError(message, properties)
¶
Instantiates an ServerError
.
Arguments:
Name | Type | Description |
---|---|---|
[message=undefined] | String|Error | See new OAuthError(message, properties). |
[properties={}] | Object | See new OAuthError(message, properties). |
[properties.code=503] | Object | See new OAuthError(message, properties). |
[properties.name=’server_error’] | String | The error name used in responses generated from this error. |
Return value:
A new instance of ServerError
.
Remarks:
const err = new ServerError();
// err.message === 'Service Unavailable Error'
// err.code === 503
// err.name === 'server_error'
name
¶
Typically 'server_error'
. See OAuthError#name.