Skip to content
Orvanov0.2.0

invalid_code

HTTP status: 401 · Code: invalid_code

The email code is wrong, expired, or used up; ask for a new one after 5 wrong tries.

The email code is wrong, expired, or used up. After 5 wrong tries the code stops working.

Let the person type the code again. After 5 wrong tries, or if it expired, ask them to request a new code. See Email codes.

Every SDK throws one error type for a failed call. Match on its code, which is always invalid_code for this error, never on the message.

import { ErrorCode, OrvanoError } from '@orvano/js'
try {
// your Orvano call
} catch (error) {
if (error instanceof OrvanoError && error.code === ErrorCode.invalidCode) {
// handle invalid_code
} else {
throw error
}
}

The error also carries the HTTP status (401), a message, and a request ID. Quote the request ID when you report a problem: the server logs it with the failure. See Errors for how errors work in every SDK, or every error code.