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

werror

package
v0.9.2 Latest Latest
Warning

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

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

Documentation

Overview

Package werror carries the platform's error conventions: sentinel errors for conditions callers branch on, and wrapping helpers that keep module and operation context attached. Named werror, not errors, so import sites never shadow the standard library.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound: the named thing does not exist (store key, module id).
	ErrNotFound = errors.New("not found")
	// ErrUnavailable: the dependency exists but cannot serve right now;
	// retrying is reasonable.
	ErrUnavailable = errors.New("unavailable")
	// ErrProtocol: the peer spoke a protocol outside the accepted window,
	// or violated the handshake. Retrying will not help.
	ErrProtocol = errors.New("protocol violation")
	// ErrDenied: the caller is authenticated but not permitted.
	ErrDenied = errors.New("denied")
)

Sentinels callers are expected to test with errors.Is.

Functions

func Op

func Op(op string, err error) error

Op wraps err with an operation label: werror.Op("store.get", err). Returns nil when err is nil so call sites can wrap unconditionally.

Types

This section is empty.

Jump to

Keyboard shortcuts

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