runtimeerror

package
v0.0.0-...-804b954 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package runtimeerror adds safe context at runtime boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(operation string, identity SafeIdentity, cause error) error

Wrap annotates cause with a safe operation and identity while preserving errors.Is and errors.As.

Types

type SafeIdentity

type SafeIdentity struct {
	// contains filtered or unexported fields
}

SafeIdentity is bounded ASCII text approved for errors and logs.

func NewSafeIdentity

func NewSafeIdentity(value string) (SafeIdentity, error)

NewSafeIdentity validates a diagnostic identity before use.

func (SafeIdentity) LogValue

func (identity SafeIdentity) LogValue() slog.Value

LogValue implements slog.LogValuer using only validated safe text.

func (SafeIdentity) String

func (identity SafeIdentity) String() string

String returns the validated safe value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL