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('@node-oauth/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 |
|
[properties={}] |
Object |
|
[properties.code=503] |
Object |
|
[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'
message
See OAuthError#message.
code
Typically 503. See OAuthError#code.
inner
See OAuthError#inner.
name
Typically 'server_error'. See OAuthError#name.