Documentation ¶
Index ¶
- func Cause(err error) (cause error)
- func CloseQuiet(f *os.File)
- func Contains(err error, sub error) bool
- func ErrorsToStrings(errs []error) []string
- func JoinErrors(errs []error) error
- func StringsToErrors(strErrs []string) []error
- func SyncQuiet(f *os.File)
- type ErrorModel
- type PodConflictErrorModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cause ¶
Cause returns the most underlying error for the provided one. There is a maximum error depth of 100 to avoid endless loops. An additional error log message will be created if this maximum has reached.
func CloseQuiet ¶
CloseQuiet closes a file and logs any error. Should only be used within a defer.
func Contains ¶
Contains checks if err's message contains sub's message. Contains should be used iff either err or sub has lost type information (e.g., due to marshalling). For typed errors, please use `errors.Contains(...)` or `Is()` in recent version of Go.
func ErrorsToStrings ¶
ErrorsToString converts the slice of errors into a slice of corresponding error messages.
func JoinErrors ¶
JoinErrors converts the error slice into a single human-readable error.
func StringsToErrors ¶
StringsToErrors converts a slice of error messages into a slice of corresponding errors.
Types ¶
type ErrorModel ¶
type ErrorModel struct { // API root cause formatted for automated parsing // example: API root cause Because string `json:"cause"` // human error message, formatted for a human to read // example: human error message Message string `json:"message"` // HTTP response code // min: 400 ResponseCode int `json:"response"` }
ErrorModel is used in remote connections with podman
func (ErrorModel) Cause ¶
func (e ErrorModel) Cause() error
func (ErrorModel) Code ¶
func (e ErrorModel) Code() int
func (ErrorModel) Error ¶
func (e ErrorModel) Error() string
type PodConflictErrorModel ¶
PodConflictErrorModel is used in remote connections with podman
func (PodConflictErrorModel) Code ¶
func (e PodConflictErrorModel) Code() int
func (PodConflictErrorModel) Error ¶
func (e PodConflictErrorModel) Error() string