Skip to main content

Class: MFAVerificationError

Defined in: src/auth/errors.ts:163

MFA verification error.

Remarks​

Thrown when MFA verification fails. HTTP mapping: 401 Unauthorized

Extends​

Constructors​

new MFAVerificationError()​

new MFAVerificationError(method, message, attemptsRemaining?): MFAVerificationError

Defined in: src/auth/errors.ts:183

Creates a new MFAVerificationError.

Parameters​

method​

string

MFA method that failed

message​

string

Error message

attemptsRemaining?​

number

Remaining attempts

Returns​

MFAVerificationError

Overrides​

ChiveError.constructor

Properties​

attemptsRemaining?​

readonly optional attemptsRemaining: number

Defined in: src/auth/errors.ts:174

Remaining attempts before lockout.


cause?​

readonly optional cause: Error

Defined in: src/types/errors.ts:71

Original error that caused this error (if any).

Remarks​

Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.

Example​

try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}

Inherited from​

ChiveError.cause


code​

readonly code: "MFA_VERIFICATION_FAILED" = 'MFA_VERIFICATION_FAILED'

Defined in: src/auth/errors.ts:164

Machine-readable error code.

Remarks​

Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).

Overrides​

ChiveError.code


method​

readonly method: string

Defined in: src/auth/errors.ts:169

MFA method that failed.