Documentation
¶
Overview ¶
Package fault defines transport-neutral semantic error kinds.
Feature packages expose a Kind through Provider without importing the HTTP or future gRPC policy layers. Transports can then map the same semantic kind independently while domain code can override that default at its boundary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kind ¶
type Kind string
Kind identifies the semantic category of an error independently of any transport status code.
const ( KindUnknown Kind = "" KindNotFound Kind = "not_found" KindAlreadyExists Kind = "already_exists" KindConstraint Kind = "constraint" KindSerialization Kind = "serialization" KindDeadlock Kind = "deadlock" KindContention Kind = "contention" KindConflict Kind = "conflict" KindTimeout Kind = "timeout" KindReadOnly Kind = "read_only" )
Semantic error kinds understood by Credo's default transport policies.
type Provider ¶
Provider is implemented by errors that expose a transport-neutral semantic kind. Implementations must keep sensitive driver metadata out of FaultKind.
func ProviderOf ¶
ProviderOf finds the first non-nil Provider in err's unwrap/join tree. A provider returning KindUnknown is still returned so transport policy can fail closed instead of falling through to an unrelated legacy interface.