Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 2.44 KB

File metadata and controls

84 lines (52 loc) · 2.44 KB

ServerError

The authorization server encountered an unexpected condition that prevented it from fulfilling the request. See :rfc:`Section 4.1.2.1 of RFC 6749 <6749#section-4.1.2.1>`.

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 See :ref:`OAuthError#constructor`.
[properties={}] Object See :ref:`OAuthError#constructor`.
[properties.code=503] Object See :ref:`OAuthError#constructor`.
[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 :ref:`OAuthError#message <OAuthError#message>`.


code

Typically 503. See :ref:`OAuthError#code <OAuthError#code>`.


inner

See :ref:`OAuthError#inner <OAuthError#inner>`.


name

Typically 'server_error'. See :ref:`OAuthError#name <OAuthError#name>`.