The API Error Handler

Generate comprehensive error handling code for API endpoints.

intermediate
35 points
coding

Instructions

Create a prompt that takes an API endpoint description and generates complete error handling code. Should cover: input validation, authentication errors, database errors, rate limiting, and proper HTTP status codes with helpful error messages.

Sample input

Your prompt is run on this input, and both the result and your prompt are graded against the goal below. Put {input} in your prompt where the sample should go, or just write instructions and the sample is sent right after them.

POST /api/users endpoint that creates a new user

Goal: Complete error handling covering validation, auth, DB errors, rate limiting with proper status codes

Hints

AI-Powered Hints

Smart

Get personalized hints based on your current progress. Start with gentle hints and progress to more detailed ones.

Tags

api
error-handling
backend
security

Access Level

FREE