Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSilent ¶
IsSilent checks if an error is marked as silent and shouldn't be printed. errors.As, not eris.As: kong wraps every command error in errors.Join, which eris can't see into.
func JoinFailures ¶ added in v0.18.1
JoinFailures joins errs' real failures. A cancel (Ctrl+C) or silent error isn't one, so it can't hide one; it's returned only if nothing failed.
func ShouldPrint ¶
ShouldPrint returns true if the error should be printed to the user. This is the inverse of IsSilent for more readable code.
Types ¶
type SilentError ¶
type SilentError struct {
// contains filtered or unexported fields
}
SilentError wraps an error to indicate it should not be printed to the user. This is useful for expected user cancellations, validation failures that have already been handled, etc.
func (*SilentError) Error ¶
func (s *SilentError) Error() string
Error implements the error interface.
func (*SilentError) Unwrap ¶
func (s *SilentError) Unwrap() error
Unwrap implements the unwrapper interface for error chains.