Skip to main content

Error Handling

Vault returns errors as JSON with success: false and a message field. Use the HTTP status code and message to decide whether to retry, fix the request, or prompt the user.

Response format

What to do by status

Handling in code

Check response.ok or response.status, then parse the JSON and use data.success and data.message. For 5xx and 429, retry after a delay. For 4xx (except 429), fix the request or show the message to the user.

Full reference