Add structured JSON error responses #14
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#15 Add input validation
austin/vektor
#13 Extract service/store layer from API handlers
austin/vektor
Reference
austin/vektor#14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 awriteError(w, status, code, message)helper that returns:Common error codes:
validation_error,not_found,unauthorized,conflict,internal_error.