Documentation
¶
Overview ¶
Package apierrors sends API errors from gin handlers. The error type and its HTTP encoding live in httperror, which has no gin dependency.
Index ¶
Constants ¶
const ( UndefinedRetry = httperror.UndefinedRetry CanRetry = httperror.CanRetry NoRetry = httperror.NoRetry )
const ShouldRetryHeader = httperror.ShouldRetryHeader
Variables ¶
This section is empty.
Functions ¶
func SendAPIError ¶
SendAPIError sends a JSON error response like SendAPIStoreError, adding error_code to the body when the error carries a semantic code, and setting Should-Retry when Retryable is explicit, otherwise leaving the header unchanged.
Types ¶
type APIError ¶
APIError represents a structured error with an HTTP status code and client-facing message.
type Retryability ¶
type Retryability = httperror.Retryability
Directories
¶
| Path | Synopsis |
|---|---|
|
Package httperror holds the API's error type and its HTTP response, with no web framework dependency, so any net/http server can answer in the API's error shape.
|
Package httperror holds the API's error type and its HTTP response, with no web framework dependency, so any net/http server can answer in the API's error shape. |