Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResponseErrorL ¶
ResponseErrorL is the business-facing localized error facade.
It validates the code, separates Params from Details, preserves the legacy HTTP/body status=400 compatibility path (D14), and delegates translation/envelope rendering to the injected wkhttp.ErrorRenderer.
ResponseErrorL writes the response but does not abort the gin chain. Handlers must return immediately after calling it, or call c.Abort() when used inside middleware.
func ResponseErrorLWithStatus ¶ added in v1.6.0
func ResponseErrorLWithStatus(c *wkhttp.Context, code codes.Code, params i18n.Params, details i18n.Details)
ResponseErrorLWithStatus is the localized error facade for endpoints that intentionally keep their real HTTP transport status instead of the legacy compatibility 400 (D14).
Use this ONLY for endpoints that have NO legacy clients depending on the fixed-400 behavior. Current consumers:
- the OIDC self-service bind flow (modules/oidc/api_bind.go) — always returned semantic codes (400/401/409/410/422/429/503);
- the Octo-link Bot bind/unbind endpoints (modules/botfather/api_user.go, POST/DELETE /v1/user/bots/:bot_id/bind) — new endpoints that must return real REST status (404/409/…) so external Agents branch on the wire code.
- The account notification-pause endpoints (modules/notification/api.go) — new settings-center endpoints whose invalid-time and storage errors expose their canonical 400/500 statuses to the client.
- the document-comment Bot mention ingress (modules/bot_mention/api.go, POST /v1/internal/bot-mentions) — a new service-to-service endpoint whose docs-backend caller branches on 401/404/409/500 retry semantics.
The body envelope is byte-for-byte identical to ResponseErrorL; only the transport status differs — here it equals the code's canonical HTTPStatus, so the wire status and error.http_status agree. For every other (legacy-bearing) endpoint use ResponseErrorL, which keeps wire=400 during the compatibility window; the fleet-wide switch to real status codes happens once in Phase 4.
Types ¶
This section is empty.