A shared folder with AI prompts and code snippets
From workspace: Bolt
Team: Main
Total snippets: 7
7 snippets
Wrap all async functions in try/catch blocks and display error messages.
Wrap all async functions in this file with try/catch. Include: – Show user-friendly error message – Log technical error to console – Avoid breaking app flow
Create a custom 404 page for unknown routes.
Create a 404 page for when users navigate to unknown routes. Include: – Friendly error message – Link to return to homepage – Responsive and styled layout
Show toast notifications when API or form errors occur.
Add toast notifications that appear on error events. Include: – Show user-friendly messages – Auto-hide after 5 seconds – Allow manual dismiss
Show appropriate UI when lists or queries return no results.
Show a clean empty state UI when data is unavailable. Include: – Icon and message – Optional button to add new item – Avoid layout shift or broken components
Add a global error boundary to catch UI rendering crashes.
Add a global error boundary component to catch UI crashes. Include: – Show fallback message – Log error for debugging – Allow retry option if possible
Add backend-side validation for required and structured data.
Add backend validation for API inputs. Include: – Check required fields – Enforce data types – Return structured error messages
Add frontend validation to all form inputs with inline error messages.
Add form validation to all inputs on this form. Include: – Show inline error messages – Email must be valid format – Required fields must be filled