Errors are not just backend problems.
Your frontend needs to handle them gracefully.
Error Boundary
An Error Boundary catches certain errors occurring during rendering/component execution so that one broken part of the UI doesnβt necessarily destroy the entire application.
Instead of:
Application crashes π₯
you might show:
Something went wrong.
[Try again]
Conceptually:
Application
βββ Navbar
βββ TaskList β error
βββ Footer
β
Error Boundary
β
"Something went wrong"
This concept is especially associated with React; Vue has its own error-handling mechanisms rather than Reactβs ErrorBoundary API.
Empty State
An empty state is not an error.
For example:
GET /api/tasks
β
200 OK
β
[]
The request succeeded.
There are simply no tasks.
Bad UX:
[blank screen]
Better:
No tasks yet.
Create your first task.
[Create Task]
Thatβs an empty state.
User Feedback
The user should know what happened.
For example:
Loading
Loading tasks...
Success
β Task created successfully
Validation error
Email is required.
API error
Could not save the task.
Please try again.
Empty state
You don't have any tasks yet.
The goal is:
Never make the user guess what the application is doing.