apperr

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 2 Imported by: 0

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