errors

package
v0.0.0-...-cb48127 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRecoverable

func IsRecoverable(err error) bool

IsRecoverable indicates if the error is recoverable

func LongForError

func LongForError(err error) string

LongForError returns LongMsg message for the error

func New

func New(short, long string) error

New creates new plugin error. ShortMsg error message is meant for the github output whereas the LongMsg message is for the internal log

func NewRecoverable

func NewRecoverable(short, long string) error

NewRecoverable creates new plugin error that does not delete the state so it can be resumed after a restart. ShortMsg error message is meant for the github output whereas the LongMsg message is for the internal log

func OmitLongMessage

func OmitLongMessage(err error) bool

OmitLongMessage indicates if the error's LongMsg message should be omitted in the github response.

func ShortForError

func ShortForError(err error) string

ShortForError returns ShortMsg message for the error

func Wrap

func Wrap(err error, shortMsg string) error

Wrap wraps an error as LongMsg and adds an additional ShortMsg question

func Wrapf

func Wrapf(err error, shortMsg string, a ...interface{}) error

Wrapf wraps an error as LongMsg and adds an additional ShortMsg question

Types

type PluginError

type PluginError struct {
	ShortMsg string
	LongMsg  string
	// contains filtered or unexported fields
}

func Builder

func Builder() *PluginError

func (*PluginError) Error

func (e *PluginError) Error() string

func (*PluginError) Recoverable

func (e *PluginError) Recoverable() *PluginError

Recoverable sets the recoverability of the error to true.

func (*PluginError) ShowLong

func (e *PluginError) ShowLong() *PluginError

ShowLong shows the LongMsg message in github response.

func (*PluginError) WithLong

func (e *PluginError) WithLong(msg string) *PluginError

WithLong sets the LongMsg message of a plugin error.

func (*PluginError) WithLongf

func (e *PluginError) WithLongf(format string, args ...interface{}) *PluginError

WithLongf templates the given message and sets it as the LongMsg message of a plugin error.

func (*PluginError) WithShort

func (e *PluginError) WithShort(msg string) *PluginError

WithShort sets the ShortMsg message of a plugin error.

func (*PluginError) WithShortf

func (e *PluginError) WithShortf(format string, args ...interface{}) *PluginError

WithShortf templates the given message and sets it as the ShortMsg message of a plugin error.

Jump to

Keyboard shortcuts

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