ctxerr

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package ctxerr allows storing and retrieving an error within a context.Context, enabling decoupled error reporting between handlers and middleware/interceptors.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(ctx context.Context) error

Err retrieves the error from the slot in ctx, or nil if none was set.

func SetErr

func SetErr(ctx context.Context, err error)

SetErr assigns an error to the error slot in ctx, if present.

func WithSlot

func WithSlot(ctx context.Context) context.Context

WithSlot attaches a mutable, thread-safe error slot to the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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