Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( TypeInvalidInput = typ{"invalid-input", 2, ""} TypeNotFound = typ{"not-found", 3, ""} TypeUnsupported = typ{"unsupported", 4, "Please check the documentation for supported features or raise an issue at https://github.com/signoz/foundry/issues for feature requests."} TypeInternal = typ{"internal", 5, ""} TypeFatal = typ{"fatal", 6, "Please raise an issue at https://github.com/signoz/foundry/issues with the error message and stacktrace."} )
Exit codes use a compact 1-6 scheme rather than BSD sysexits.h. sysexits would force TypeInternal and TypeFatal to share EX_SOFTWARE (70), and the distinction matters: TypeFatal marks a recovered panic that should page, TypeInternal marks an expected-but-failed path. The custom scheme keeps those orthogonal and stays easy to remember in shell scripts.
The action string is the remediation hint surfaced to users (via the slog "exception" payload and the --format=json error envelope). Co-locating it with the type means adding a new error class is a one-place change.
Functions ¶
Types ¶
type Envelope ¶ added in v0.2.4
type Envelope struct {
Exception *Exception
}
func EnvelopeOf ¶ added in v0.2.4
func (Envelope) MarshalJSON ¶ added in v0.2.4
type Exception ¶ added in v0.2.4
type Exception struct {
Type string `json:"type,omitempty"`
Message string `json:"message"`
Cause *Exception `json:"cause,omitempty"`
Action string `json:"action,omitempty"`
Stacktrace string `json:"stacktrace,omitempty"`
}
func ExceptionOf ¶ added in v0.2.4
The walk terminates at the first non-*base link, which emits Message alone — stdlib wrappers format their full subtree in Error(), so re-walking them would duplicate that text. Stacktrace emits on TypeFatal links only; every *base captures one at construction time but emitting them all is noise.