Frontend Checklist

Error Handling Checklist

Every error must be shown to the user. No error stays only in the console. No form resets after a failed submission. Every error has a human-readable message and a clear next step.

Back to Frontend Checklist 0/0 completed

Demo 1 — Field-Level Error

Click “Trigger Field Error” to show an inline field error beneath the input. Click “Clear Error” or start typing to dismiss it.

Email Field with Inline Error



Demo 2 — Form Banner Error

Click “Trigger API Error” to show a persistent red banner at the top of the form. Dismiss it with the × button.

Mini Form with API Error Banner
Unable to save changes.
You do not have permission to edit this project.



Demo 3 — Page-Level Error

Toggle between normal data view and error states. Retry simulates recovering from the error after 1.2 seconds.

Page State Switcher
Projects loaded successfully
Showing 12 projects across 3 teams.
Alpha Project Active
Beta Dashboard Draft
Gamma Campaign Paused
⚠️

Something went wrong.

We couldn't load your projects. This is our fault, not yours.

📡

No internet connection.

Check your connection and try again. Your unsaved data is still here.




Error Types & Where They Appear

Error Type Source Where to Show
Required field emptyClient validationInline below the field
Invalid formatClient validationInline below the field
Business rule failureAPI responseInline field or form banner
API server errorAPI responseForm banner or error toast
Network failureBrowser/fetchToast or inline banner
Session expiredAPI responseRedirect to login with message

API Error Code → User Message Mapping

Map every API error code to a plain-English message before displaying it. Never show raw codes or stack traces.

Error Code HTTP Status User-Facing Message
AUTH_REQUIRED 401 Please log in to continue.
FORBIDDEN 403 You don't have permission to do this.
NOT_FOUND 404 This record no longer exists.
VALIDATION_ERROR 422 Shows field-level errors inline.
SERVER_ERROR 500 Something went wrong. Please try again.
NETWORK_ERROR Check your internet connection.

Permission and Auth Errors



What Never to Do