Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 2.59 KB

File metadata and controls

84 lines (52 loc) · 2.59 KB

InvalidArgumentError

An invalid argument was encountered.

const InvalidArgumentError = require('@node-oauth/oauth2-server/lib/errors/invalid-argument-error');

Note

This error indicates that the module is used incorrectly (i.e., there is a programming error) and should never be seen because of external errors (like invalid data sent by a client).


new InvalidArgumentError(message, properties)

Instantiates an InvalidArgumentError.

Arguments:

Name Type Description
[message=undefined] String|Error See :ref:`OAuthError#constructor`.
[properties={}] Object See :ref:`OAuthError#constructor`.
[properties.code=500] Object See :ref:`OAuthError#constructor`.
[properties.name='invalid_argument'] String The error name used in responses generated from this error.

Return value:

A new instance of InvalidArgumentError.

Remarks:

const err = new InvalidArgumentError();
// err.message === 'Internal Server Error'
// err.code === 500
// err.name === 'invalid_argument'

message

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


code

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


inner

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


name

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