Skip to main content

Error response format

All API errors use the same envelope:
For validation errors, an additional details field maps each invalid field to an array of messages:

Error code reference

Handling errors in the frontend

The Axios instance in AspFox’s frontend has a response interceptor that normalizes error responses. In your feature code, you can check error.response.data.error.code:
TanStack Query surfaces errors in mutation.error and query.error. The Axios interceptor handles 401 UNAUTHORIZED globally — it attempts a token refresh and retries the request before surfacing the error to your component.