Help us shape the future of Go! Take the 2026 Go Developer Survey

errrep

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package errrep wires the Sentry-protocol-compatible error reporter. When DSN is empty, every entry point becomes a no-op so callers don't need to branch. The wire format works against either Sentry SaaS or a self-hosted GlitchTip instance (the lean per S03 sprint spec).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaptureException

func CaptureException(err error)

CaptureException reports an error. Safe to call when the SDK is not configured (it's a no-op).

func CapturePanic

func CapturePanic(recovered any, requestID string)

CapturePanic reports a recovered panic value. requestID is used to correlate with logs and traces.

func Init

func Init(cfg Config) (func(context.Context) error, error)

Init initializes the SDK. Returns a flush function the caller calls on shutdown to drain any queued events. When DSN is empty Init is a no-op and the returned flush is a no-op too.

Types

type Config

type Config struct {
	DSN         string
	Environment string
	Release     string
}

Config controls SDK initialization.

type SlogHandler

type SlogHandler struct {
	Inner slog.Handler
}

SlogHandler wraps an underlying slog.Handler so that records at error level are also reported to Sentry. Other levels pass through unchanged.

func (*SlogHandler) Enabled

func (h *SlogHandler) Enabled(ctx context.Context, level slog.Level) bool

func (*SlogHandler) Handle

func (h *SlogHandler) Handle(ctx context.Context, r slog.Record) error

func (*SlogHandler) WithAttrs

func (h *SlogHandler) WithAttrs(attrs []slog.Attr) slog.Handler

func (*SlogHandler) WithGroup

func (h *SlogHandler) WithGroup(name string) slog.Handler

Jump to

Keyboard shortcuts

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