errors

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 3 Imported by: 31

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleExit

func HandleExit(err error)

HandleExit ist used within the main handler to exit properly.

Types

type ExitCoder

type ExitCoder interface {
	error
	Code() int
	Fields() logrus.Fields
}

ExitCoder defines the interface for exit code handling.

type ExitError

type ExitError struct {
	// contains filtered or unexported fields
}

ExitError simply implements the defined interface.

func ExitMessage

func ExitMessage(message interface{}) ExitError

ExitMessage initializes a new ExitCoder implementation.

func ExitMessagef added in v0.3.1

func ExitMessagef(format string, a ...interface{}) ExitError

ExitMessagef initializes a new ExitCoder implementation.

func WithFields

func WithFields(message interface{}, fields logrus.Fields) ExitError

WithFields initializes a new ExitCoder implementation.

func (ExitError) Code

func (e ExitError) Code() int

Code implements the ExitCoder interface.

func (ExitError) Error

func (e ExitError) Error() string

Error implements the ExitCoder interface.

func (ExitError) Fields

func (e ExitError) Fields() logrus.Fields

Fields implements the ExitCoder interface.

Jump to

Keyboard shortcuts

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