Documentation
¶
Index ¶
- func AlreadyReported(err error) bool
- func FailureLevel(ctx context.Context, err error) (slog.Level, bool)
- func HTTPBody(raw []byte, secret string) string
- func HTTPOperation(method, path string) string
- func MarkReported(err error) error
- func Wrap(api protocol.APIError, cause error) error
- type HTTPError
- type Record
- type Reporter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlreadyReported ¶
AlreadyReported reports whether err carries a diagnostic ownership marker.
func FailureLevel ¶
FailureLevel classifies an operation failure for diagnostic logging.
func HTTPBody ¶ added in v0.9.4
HTTPBody bounds retained error payloads without retaining response objects.
func HTTPOperation ¶ added in v0.9.4
HTTPOperation removes user-controlled path segments and query parameters.
func MarkReported ¶
MarkReported marks err as already reported by its diagnostic owner.
Types ¶
type HTTPError ¶ added in v0.9.4
type HTTPError struct {
Operation string
Phase string
Status int
Body string
Cause error
CauseText string
RetryDelay time.Duration
}
HTTPError retains upstream diagnostics outside the public API error. Only the logging boundary may render DiagnosticText; Error deliberately stays safe.
func HandshakeError ¶ added in v0.9.4
func HandshakeError(operation string, response *http.Response, cause error, secret string) *HTTPError
HandshakeError captures the failed websocket dial response. The websocket adapter returns a closed-network-body copy capped at 1024 bytes; mark that upstream library limit rather than claiming a complete error payload.
func (*HTTPError) DiagnosticText ¶ added in v0.9.4
DiagnosticText returns original error text for a redacting, bounded logger.
func (*HTTPError) HideSecret ¶
HideSecret removes a known controller credential from the rendered copy while retaining the original cause for errors.Is/As. Call after adding all causes.
func (*HTTPError) RetryAfter ¶ added in v0.9.4
RetryAfter exposes a parsed upstream retry delay to the provider read policy.