This class covers all errors that occur while acquiring authorization to perform an operation on NoSQL DB. Because there could be several problems acquiring authorization, the errors of this class may have one of several error codes:

  • BAD_PROTOCOL_MESSAGE indicates problem in authorization protocol.
  • ILLEGAL_STATE indicates that authorization operation encountered unexpected state, such as missing or invalid information received from authorization server. See the error message for details.
  • ILLEGAL_ARGUMENT indicates problem with authorization configuration provided as AuthConfig when NoSQLClient instance is created.
  • REQUEST_TIMEOUT indicates that timeout was exceeded trying to obtain authorization information.
  • SERVICE_ERROR indicates unsuccessful response from authorization server. This may be due to many factors, including invalid user credentials (user name and password). See error message for more information
  • UNAUTHORIZED may indicate insufficient permissions while trying to obtain authorization information.
  • CREDENTIALS_ERROR indicates error accessing user or application credentials. The reason for this error depends on what credential provider is used for the authorization.
  • NETWORK_ERROR indicates error communicating with the authorization server. This error code is used for errors not due to any cases above.

Because the error could have different causes even for the same error code, it is important to check the message of the error as well as its cause. The message should contain HTTP status code and authorization server response if they are present.

Note that this class is used only for errors that occur while trying to obtain authorization string from authorization provider and not errors that occur when making request to NoSQL DB with invalid authorization string. In the latter case, NoSQLError is returned with error code INVALID_AUTHORIZATION.

Hierarchy

Properties

cause?: Error

An error that caused this error. In many cases it is also instance of NoSQLError and may itself have a cause. You could iterate through the chain of causes like this:

for(let cause = err.cause; cause; cause = cause.cause) {...

If this error does not have a cause, the value of this property is undefined.

errorCode: ErrorCode

ErrorCode of this error.

message: string
name: string
operation?: Config | Operation

Operation that resulted in this error. Operation object contains the API and its arguments including the options used. Operation object may not always be available, in which case the value of this property is undefined.

If this error happened during creation of new NoSQLClient then instead of Operation this property contains Config used to create NoSQLClient instance.

See

retryable?: boolean

Indicates whether this error is retryable.

APIs that result in retryable errors are automatically retried by the driver's default RetryHandler. Default retry handler can be customized by properties in RetryConfig. Alternatively, a custom RetryHandler can be set as handler.

If necessary, APIs that result in retryable errors may also be explicitly retried by the application.

See

RetryConfig

stack?: string
prepareStackTrace?: ((err: Error, stackTraces: CallSite[]) => any)

Type declaration

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: Object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc