Documentation
¶
Index ¶
- Constants
- func AlreadyReported(err error) bool
- func FailureLevel(ctx context.Context, err error) (slog.Level, bool)
- func HTTPBody(raw []byte) string
- func HTTPOperation(method, path string) string
- func MarkReported(err error) error
- func NormalCancellation(ctx context.Context, err error) bool
- func Wrap(api protocol.APIError, cause error) error
- type HTTPError
- type Record
- type Reporter
Constants ¶
const MaxHTTPBodyBytes = 256 << 10
MaxHTTPBodyBytes bounds retained upstream failure bodies, before JSON encoding.
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.
func NormalCancellation ¶ added in v0.9.4
NormalCancellation reports whether only cancellation caused an ended operation. It lets non-log failure callbacks retain their shutdown semantics.
Types ¶
type HTTPError ¶ added in v0.9.4
type HTTPError struct {
Operation string
URL string
Phase string
Status int
Body string
Cause error
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
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 HTTP details for the file diagnostic boundary.
func (*HTTPError) RetryAfter ¶ added in v0.9.4
RetryAfter exposes a parsed upstream retry delay to the provider read policy.