Skip to content

Latest commit

 

History

History
84 lines (52 loc) · 2.58 KB

invalid-argument-error.rst

File metadata and controls

84 lines (52 loc) · 2.58 KB

InvalidArgumentError

An invalid argument was encountered.

const InvalidArgumentError = require('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 OAuthError#constructor.
[properties={}] Object See OAuthError#constructor.
[properties.code=500] Object See 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 OAuthError#message <OAuthError#message>.


code

Typically 500. See OAuthError#code <OAuthError#code>.


inner

See OAuthError#inner <OAuthError#inner>.


name

Typically 'invalid_argument'. See OAuthError#name <OAuthError#name>.