Documentation
¶
Index ¶
- Variables
- func Config(code Code, operation, message string, cause error) error
- func FormatInvalidURL(raw, detail string) string
- func Metric(code Code, message string, cause error) error
- func MetricParse(message string, cause error) error
- func RedactedURL(raw string) string
- func RetryableStatus(code int) bool
- func Validation(code Code, operation, field, message string, cause error) error
- type Code
- type Error
- func (e *Error) Error() string
- func (e *Error) GaugoBodyBytes() int
- func (e *Error) GaugoErrorCode() string
- func (e *Error) GaugoErrorKind() string
- func (e *Error) GaugoField() string
- func (e *Error) GaugoLimitBytes() int64
- func (e *Error) GaugoModel() string
- func (e *Error) GaugoOperation() string
- func (e *Error) GaugoProvider() string
- func (e *Error) GaugoRequestID() string
- func (e *Error) GaugoRetryable() bool
- func (e *Error) GaugoStatusCode() int
- func (e *Error) GaugoWire() string
- func (e *Error) Info() Info
- func (e *Error) Is(target error) bool
- func (e *Error) Unwrap() error
- type Info
- type Kind
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrConfig error = sentinel{/* contains filtered or unexported fields */} ErrValidation error = sentinel{/* contains filtered or unexported fields */} ErrMetric error = sentinel{/* contains filtered or unexported fields */} ErrMetricParse error = sentinel{/* contains filtered or unexported fields */} ErrProviderRequest error = sentinel{/* contains filtered or unexported fields */} ErrProviderAuth error = sentinel{/* contains filtered or unexported fields */} ErrProviderRateLimit error = sentinel{/* contains filtered or unexported fields */} ErrProviderResponse error = sentinel{/* contains filtered or unexported fields */} ErrProviderRefusal error = sentinel{/* contains filtered or unexported fields */} ErrProviderTruncated error = sentinel{/* contains filtered or unexported fields */} ErrPanic error = sentinel{/* contains filtered or unexported fields */} )
Functions ¶
func FormatInvalidURL ¶
func MetricParse ¶
func RedactedURL ¶
func RetryableStatus ¶
Types ¶
type Code ¶
type Code string
Code is a stable machine-readable reason for a Gaugo failure.
const ( CodeUnknown Code = "unknown" CodeConfigInvalid Code = "config_invalid" CodeRunnerConfigInvalid Code = "runner_config_invalid" CodeValidationInvalid Code = "validation_invalid" CodeContextCanceled Code = "context_canceled" CodeContextDeadline Code = "context_deadline" CodeCaseInvalid Code = "case_invalid" CodeRetryInvalid Code = "retry_invalid" CodeMetricInvalid Code = "metric_invalid" CodeMetricParse Code = "metric_parse" CodeProviderConfigInvalid Code = "provider_config_invalid" CodeProviderAPIKeyRequired Code = "provider_api_key_required" CodeProviderHTTPRequest Code = "provider_http_request" CodeProviderHTTPStatus Code = "provider_http_status" CodeProviderResponseDecode Code = "provider_response_decode" CodeProviderResponseInvalid Code = "provider_response_invalid" CodeProviderResponseTooLarge Code = "provider_response_too_large" CodeProviderRefusal Code = "provider_refusal" CodeProviderTruncated Code = "provider_truncated" CodePanic Code = "panic" )
type Error ¶
type Error struct {
Kind Kind
Code Code
Message string
Operation string
Field string
Provider string
Wire string
Model string
StatusCode int
RequestID string
BodyBytes int
LimitBytes int64
Retryable bool
Err error
}
Error is Gaugo's typed operational error. It keeps a human message, structured integration metadata, and an optional wrapped cause.
func (*Error) GaugoBodyBytes ¶
func (*Error) GaugoErrorCode ¶
func (*Error) GaugoErrorKind ¶
func (*Error) GaugoField ¶
func (*Error) GaugoLimitBytes ¶
func (*Error) GaugoModel ¶
func (*Error) GaugoOperation ¶
func (*Error) GaugoProvider ¶
func (*Error) GaugoRequestID ¶
func (*Error) GaugoRetryable ¶
func (*Error) GaugoStatusCode ¶
type Info ¶
type Info struct {
Kind Kind `json:"kind,omitempty"`
Code Code `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Operation string `json:"operation,omitempty"`
Field string `json:"field,omitempty"`
Provider string `json:"provider,omitempty"`
Wire string `json:"wire,omitempty"`
Model string `json:"model,omitempty"`
StatusCode int `json:"status_code,omitempty"`
RequestID string `json:"request_id,omitempty"`
BodyBytes int `json:"body_bytes,omitempty"`
LimitBytes int64 `json:"limit_bytes,omitempty"`
Retryable bool `json:"retryable,omitempty"`
}
Info is a redacted, structured description of an operational failure.
type Kind ¶
type Kind string
Kind classifies operational failures separately from low quality scores.
const ( KindUnknown Kind = "unknown" KindConfig Kind = "config" KindValidation Kind = "validation" KindContextCanceled Kind = "context_canceled" KindContextDeadline Kind = "context_deadline" KindPanic Kind = "panic" KindMetric Kind = "metric" KindMetricParse Kind = "metric_parse" KindProviderRequest Kind = "provider_request" KindProviderAuth Kind = "provider_auth" KindProviderRateLimit Kind = "provider_rate_limit" KindProviderResponse Kind = "provider_response" KindProviderRefusal Kind = "provider_refusal" KindProviderTruncated Kind = "provider_truncated" )
func KindFromStatusCode ¶
Click to show internal directories.
Click to hide internal directories.