mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
feat(api): give every error envelope a meta.errorCode
Roughly half of the refusals answered prose alone, so a client could branch on the code for one 404 and had to fall back to the status for the next. apiHandler now completes every error envelope with the status's generic http.* code when the route named none; a route's own code still wins. The family joins the published catalogue, and the profile form only shows a code's sentence when the code has one.
This commit is contained in:
1 parent
c7f69fc212
commit
fbbb535832
11 files changed
+219
-50
No files matched your search
@@ -211,6 +211,25 @@ export const ERROR_CODE_CATALOGUE: Readonly<Record<string, readonly string[]>> =
|
||||
"health_score_config.invalid",
|
||||
"health_score_config.too_narrow",
|
||||
],
|
||||
http: [
|
||||
"http.bad_gateway",
|
||||
"http.bad_request",
|
||||
"http.client_error",
|
||||
"http.conflict",
|
||||
"http.forbidden",
|
||||
"http.gateway_timeout",
|
||||
"http.gone",
|
||||
"http.internal",
|
||||
"http.invalid",
|
||||
"http.method_not_allowed",
|
||||
"http.not_found",
|
||||
"http.payload_too_large",
|
||||
"http.rate_limited",
|
||||
"http.server_error",
|
||||
"http.unauthenticated",
|
||||
"http.unavailable",
|
||||
"http.unsupported_media_type",
|
||||
],
|
||||
illness: [
|
||||
"illness.day-log.invalid",
|
||||
"illness.disabled",
|
||||
|
||||
Reference in new issue
Block a user