jerr

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: BSD-3-Clause Imports: 3 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 jerr prints errors and, for command-line programs, exits.

Die and Dief are for the "unrecoverable error, print it and stop" moment: the message goes to stderr, a stack trace is added when DEBUG is set in the environment, and the process exits with code 1. Warn and Warnf print without exiting.

The plain variants print the error itself. The formatted variants print your message; the error is not printed unless you put it in the format:

jerr.Warnf(err, "create %s: %v", name, err)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Die

func Die(err error)

Die prints err and exits with code 1. It does nothing when err is nil.

func Dief

func Dief(err error, format string, a ...any)

Dief prints the formatted message like Warnf and then exits with code 1. It does nothing when err is nil.

func Warn

func Warn(err error) error

Warn prints err and returns it. It does nothing when err is nil.

func Warnf

func Warnf(err error, format string, a ...any) error

Warnf prints the formatted message and returns err. It does nothing when err is nil. The error is not printed; put it in the format to show it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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