autherr

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeUnknownError      = 1
	CodeUnknownSubcommand = 2 // Also happens to be used for flag.Parse errors, which is fitting
	CodeUnimplemented     = 3
	CodeBadParams         = 4
	CodeAuthFailure       = 5
	CodeTokenStoreFailure = 6
	CodeReauthRequired    = 7
)

Variables

View Source
var UnexpectedHTML = errors.New("request to JSON API returned HTML unexpectedly")

Functions

func CodedErrorf

func CodedErrorf(code int, format string, args ...any) error

func ReauthRequired

func ReauthRequired(cluster string) error

Types

type CodedError

type CodedError struct {
	Code int
	Err  error
}

CodedError wraps an error with an integer code that can be used as e.g. a return code from an application.

func (*CodedError) Error

func (e *CodedError) Error() string

func (*CodedError) ExitCode

func (e *CodedError) ExitCode() int

Jump to

Keyboard shortcuts

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