apperr

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 2 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 apperr defines the user-facing error type used across commit-spark.

A UserError carries a message that is safe to print directly to the user without a stack trace or bug-report footer. Everything else is treated as an unexpected (internal) error by the CLI layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUser

func IsUser(err error) bool

IsUser reports whether err is, or wraps, a *UserError. Because it uses errors.As it keeps working through fmt.Errorf("...: %w", err) chains.

func New

func New(message string) error

New returns a *UserError with a literal message. Use this (not Newf) when the message contains no formatting verbs, so a stray '%' cannot break it.

func Newf

func Newf(format string, args ...any) error

Newf returns a *UserError with a printf-formatted message. The trailing "f" lets go vet check the format string against its arguments.

Types

type UserError

type UserError struct{ Message string }

UserError is an error whose message is safe to show the user verbatim.

func (*UserError) Error

func (e *UserError) Error() string

Error implements the error interface.

Jump to

Keyboard shortcuts

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