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

Evaluation results

100%

78%

Room Booking API

Criteria
Without context
With context

Custom exception hierarchy

0%

100%

Exception handler for custom errors

0%

100%

RequestValidationError handler

0%

100%

Generic Exception catch-all

0%

100%

Consistent error response shape

41%

100%

Correct HTTP status codes for business rules

60%

100%

No stack traces in error responses

100%

100%

Server-side error logging

0%

100%

Validation details include field names

37%

100%

95%

82%

Product Inventory API

Criteria
Without context
With context

Custom exception classes for domain errors

0%

83%

Exception handler for custom errors registered

0%

100%

RequestValidationError handler registered

0%

100%

Generic catch-all Exception handler

0%

100%

Consistent structured error format across all routes

25%

100%

No internal details leaked

50%

100%

Semantically correct HTTP status codes

60%

70%

Errors logged server-side

0%

100%

Validation error field details

0%

100%

98%

81%

Order Management API

Criteria
Without context
With context

Custom exception classes defined

0%

83%

Exception handler for custom errors registered

0%

100%

RequestValidationError handler registered

0%

100%

Generic Exception catch-all handler

0%

100%

Consistent error response structure

33%

100%

No internal details leaked in errors

50%

100%

Semantically correct HTTP status codes

70%

100%

Server-side error logging

0%

100%

Validation errors include field-level detail

25%

100%

98%

84%

Payment Processing API

Criteria
Without context
With context

Custom exception hierarchy defined

0%

100%

Exception handler for custom errors registered

0%

100%

RequestValidationError handler registered

0%

100%

Generic Exception handler registered

0%

100%

Consistent structured error response format

33%

100%

No stack traces leaked in error responses

60%

100%

Business logic errors use appropriate HTTP status codes

50%

75%

Errors are logged server-side

0%

100%

Pydantic validation details include field names

0%

100%

100%

82%

User Registration and Profile API

Criteria
Without context
With context

Custom exception classes defined

0%

100%

Exception handler for custom errors registered

0%

100%

RequestValidationError handler registered

0%

100%

Generic Exception catch-all handler

0%

100%

Consistent error response shape

33%

100%

Password never in error details

100%

100%

Appropriate HTTP status codes for domain errors

60%

100%

Server-side error logging

0%

100%

Validation error details include field names

0%

100%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents