Class: WebAuthnError
Defined in: src/auth/errors.ts:199
WebAuthn error.
Remarks
Thrown when WebAuthn operations fail. HTTP mapping: 400 Bad Request or 401 Unauthorized
Extends
Constructors
new WebAuthnError()
new WebAuthnError(
webauthnError,message,cause?):WebAuthnError
Defined in: src/auth/errors.ts:220
Creates a new WebAuthnError.
Parameters
webauthnError
Specific error type
"registration_failed" | "authentication_failed" | "credential_not_found" | "invalid_challenge" | "counter_mismatch" | "attestation_failed"
message
string
Error message
cause?
Error
Original error
Returns
Overrides
Properties
cause?
readonlyoptionalcause: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
code
readonlycode:"WEBAUTHN_ERROR"='WEBAUTHN_ERROR'
Defined in: src/auth/errors.ts:200
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
webauthnError
readonlywebauthnError:"registration_failed"|"authentication_failed"|"credential_not_found"|"invalid_challenge"|"counter_mismatch"|"attestation_failed"
Defined in: src/auth/errors.ts:205
Specific WebAuthn error type.