CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/go-error-handling

Error handling for Go HTTP servers — structured error responses, error wrapping,

88

1.80x
Quality

81%

Does it follow best practices?

Impact

99%

1.80x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

Evaluation results

98%

35%

Build an Employee Directory API

Criteria
Without context
With context

Custom error type

8%

100%

Structured JSON error responses

50%

100%

writeError helper

100%

100%

Recovery middleware

0%

100%

Graceful shutdown

0%

100%

Referential integrity errors

100%

100%

Uniqueness conflicts

100%

100%

Foreign key validation

100%

87%

Not-found handling

100%

100%

No internal error leaks

100%

100%

All endpoints functional

100%

100%

100%

63%

Build an Inventory Management API

Criteria
Without context
With context

Custom error type

0%

100%

Unwrap method

0%

100%

Structured JSON error response

33%

100%

writeError helper

100%

100%

Recovery middleware

0%

100%

Graceful shutdown

0%

100%

No internal error leaks

30%

100%

Appropriate status codes

90%

100%

Validation with detail

75%

100%

Error wrapping with %w

0%

100%

All endpoints functional

100%

100%

100%

37%

Build a Parking Reservation API

Criteria
Without context
With context

Custom error type

16%

100%

Structured JSON error responses

58%

100%

writeError helper

100%

100%

Recovery middleware

0%

100%

Graceful shutdown

0%

100%

Business rule errors with proper codes

90%

100%

Uniqueness conflict as 409

100%

100%

Not-found handling

100%

100%

No internal error leaks

87%

100%

Validation with details

100%

100%

All endpoints functional

100%

100%

100%

37%

Build a Recipe Sharing API

Criteria
Without context
With context

Custom error type

16%

100%

Structured JSON error responses

58%

100%

writeError helper

100%

100%

Recovery middleware

0%

100%

Graceful shutdown

0%

100%

Authorization error as 403

100%

100%

Validation with field details

70%

100%

Not-found returns 404

100%

100%

No internal error leaks

100%

100%

Appropriate status codes

100%

100%

All endpoints functional

100%

100%

100%

47%

Build a Task Tracker API

Criteria
Without context
With context

Custom error type

0%

100%

Structured JSON error responses

50%

100%

writeError helper

100%

100%

Recovery middleware

0%

100%

Graceful shutdown

0%

100%

No internal error leaks

90%

100%

Validation status enum

100%

100%

Not-found handling

87%

100%

Appropriate status codes

80%

100%

Error wrapping with %w

0%

100%

All endpoints functional

100%

100%

Evaluated
Agent
Claude Code
Model
Claude Sonnet 4.6

Table of Contents