Add structured JSON error responses #14

Open
opened 2026-03-16 22:27:41 +00:00 by austin · 0 comments
Owner

Currently all API errors use http.Error(w, "message", status) which returns plain text. This makes it hard for the CLI and frontend to handle errors programmatically.

What needs to happen

Replace all http.Error() calls with a writeError(w, status, code, message) helper that returns:

{"error": "not_found", "message": "issue not found"}

Common error codes: validation_error, not_found, unauthorized, conflict, internal_error.

Currently all API errors use `http.Error(w, "message", status)` which returns plain text. This makes it hard for the CLI and frontend to handle errors programmatically. ## What needs to happen Replace all `http.Error()` calls with a `writeError(w, status, code, message)` helper that returns: ```json {"error": "not_found", "message": "issue not found"} ``` Common error codes: `validation_error`, `not_found`, `unauthorized`, `conflict`, `internal_error`.
austin self-assigned this 2026-03-16 22:27:41 +00:00
austin added this to the Vektor - CLI project 2026-03-16 22:27:41 +00:00
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
austin/vektor#14
No description provided.