errors

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package errors holds the domain sentinel errors shared by every rule use case. Centralizing them keeps the scenario packages free of circular imports and gives the controller a single, stable place to map rule failures onto HTTP statuses. Import aliased (e.g. ruleerrors) to avoid shadowing the standard library.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a rule (or the custom rule targeted by a
	// mutation) does not exist.
	ErrNotFound = errors.New("rule not found")
	// ErrBuiltin is returned when a mutation targets a built-in rule that is
	// immutable via the API (disabling is the only permitted exception).
	ErrBuiltin = errors.New("rule is built-in and immutable via the API")
	// ErrAlreadyExists is returned when creating a rule whose ID is already
	// taken by a built-in or custom rule.
	ErrAlreadyExists = errors.New("rule already exists")
	// ErrTooManyRules is returned when creating a rule would exceed the
	// configured maximum number of custom rules.
	ErrTooManyRules = errors.New("too many custom rules")
)

Sentinel errors mapped to HTTP statuses by the controller.

Functions

This section is empty.

Types

type ValidationError

type ValidationError struct{ Err error }

ValidationError wraps a rule-content problem (bad regex, unknown validator, bad data type, bad ID); the controller maps it to 400.

func (*ValidationError) Error

func (e *ValidationError) Error() string

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Jump to

Keyboard shortcuts

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