CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/fastapi-error-handling

Production error handling for FastAPI — exception handlers, structured error

96

6.12x
Quality

96%

Does it follow best practices?

Impact

98%

6.12x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Room Booking API

Build a meeting room booking API with FastAPI and Python. The API manages rooms and reservations.

Endpoints

  • POST /api/rooms -- create a room with name: str, capacity: int (> 0), floor: int
  • GET /api/rooms -- list all rooms, with optional min_capacity: int filter
  • POST /api/bookings -- create a booking with room_id: int, title: str, start_time: datetime, end_time: datetime, organizer_email: str
  • GET /api/bookings/{booking_id} -- get booking details
  • DELETE /api/bookings/{booking_id} -- cancel a booking
  • GET /api/rooms/{room_id}/availability -- check room availability for a given date: date query param

Business rules:

  • Bookings cannot overlap for the same room
  • End time must be after start time
  • Bookings cannot be in the past
  • A cancelled booking cannot be cancelled again
  • Room name must be unique per floor

Output

Produce Python files:

  • app/main.py -- FastAPI app with all routes
  • app/schemas.py -- Pydantic request/response models
  • app/db.py -- in-memory data store (no real database)

Do not include test files or deployment configuration.

evals

scenario-1

criteria.json

task.md

tile.json