errs

package
v0.0.0-...-1a11905 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualArguments

func EqualArguments(ctx *cli.Context, arg1, arg2 string) error

EqualArguments returns an error saying that the given positional arguments cannot be equal.

func FileError

func FileError(err error, filename string) error

FileError is a wrapper for errors of the os package.

func FlagValueInsecure

func FlagValueInsecure(ctx *cli.Context, flag string, value string) error

FlagValueInsecure returns an error with the given flag and value requiring the --insecure flag.

func IncompatibleFlag

func IncompatibleFlag(ctx *cli.Context, flag string, value string) error

IncompatibleFlag returns an error with the flag being incompatible with the given value.

func IncompatibleFlagValue

func IncompatibleFlagValue(ctx *cli.Context, flag, incompatibleWith,
	incompatibleWithValue string) error

IncompatibleFlagValue returns an error with the flag being incompatible with the given value.

func IncompatibleFlagValueWithFlagValue

func IncompatibleFlagValueWithFlagValue(ctx *cli.Context, flag string, value string,
	withFlag string, withValue, options string) error

IncompatibleFlagValueWithFlagValue returns an error with the given value being missing or invalid for the given flag. Optionally it lists the given formatted options at the end.

func IncompatibleFlagValues

func IncompatibleFlagValues(ctx *cli.Context, flag, value, incompatibleWith,
	incompatibleWithValue string) error

IncompatibleFlagValues returns an error with the flag being incompatible with the given value.

func IncompatibleFlagWithFlag

func IncompatibleFlagWithFlag(ctx *cli.Context, flag string, withFlag string) error

IncompatibleFlagWithFlag returns an error with the flag being incompatible with the given value.

func InsecureArgument

func InsecureArgument(ctx *cli.Context, name string) error

InsecureArgument returns an error with the given argument requiring the --insecure flag.

func InsecureCommand

func InsecureCommand(ctx *cli.Context) error

InsecureCommand returns an error with a message saying that the current command requires the insecure flag.

func InvalidFlagValue

func InvalidFlagValue(ctx *cli.Context, flag string, value string, options string) error

InvalidFlagValue returns an error with the given value being missing or invalid for the given flag. Optionally it lists the given formatted options at the end.

func MinMaxNumberOfArguments

func MinMaxNumberOfArguments(ctx *cli.Context, min, max int) error

MinMaxNumberOfArguments returns nil if the number of positional arguments between the min/max range. It will return an appropriate error if they are not.

func MinSizeFlag

func MinSizeFlag(ctx *cli.Context, flag string, size string) error

MinSizeFlag returns an error with a greater or equal message message for the given flag and size.

func MinSizeInsecureFlag

func MinSizeInsecureFlag(ctx *cli.Context, flag, size string) error

MinSizeInsecureFlag returns an error with a requiring --insecure flag message with the given flag an size.

func MissingArguments

func MissingArguments(ctx *cli.Context, argNames ...string) error

MissingArguments returns an error with a missing arguments message for the given positional argument names.

func MutuallyExclusiveFlags

func MutuallyExclusiveFlags(ctx *cli.Context, flag1, flag2 string) error

MutuallyExclusiveFlags returns an error with mutually exclusive message for the given flags.

func NewError

func NewError(format string, args ...interface{}) error

NewError returns a new Error for the given format and arguments

func NewExitError

func NewExitError(err error, exitCode int) error

NewExitError returns an error that the urfave/cli package will handle and will show the given error and exit with the given code.

func NumberOfArguments

func NumberOfArguments(ctx *cli.Context, required int) error

NumberOfArguments returns nil if the number of positional arguments is equal to the required one. It will return an appropriate error if they are not.

func RequiredFlag

func RequiredFlag(ctx *cli.Context, flag string) error

RequiredFlag returns an error with the required flag message.

func RequiredInsecureFlag

func RequiredInsecureFlag(ctx *cli.Context, flag string) error

RequiredInsecureFlag returns an error with the given flag requiring the insecure flag message.

func RequiredOrFlag

func RequiredOrFlag(ctx *cli.Context, flags ...string) error

RequiredOrFlag returns an error with a list of flags being required messages.

func RequiredSubtleFlag

func RequiredSubtleFlag(ctx *cli.Context, flag string) error

RequiredSubtleFlag returns an error with the given flag requiring the subtle flag message..

func RequiredUnlessFlag

func RequiredUnlessFlag(ctx *cli.Context, flag, unlessFlag string) error

RequiredUnlessFlag returns an error with the required flag message unless the specified flag is used.

func RequiredUnlessInsecureFlag

func RequiredUnlessInsecureFlag(ctx *cli.Context, flag string) error

RequiredUnlessInsecureFlag returns an error with the required flag message unless the insecure flag is used.

func RequiredUnlessSubtleFlag

func RequiredUnlessSubtleFlag(ctx *cli.Context, flag string) error

RequiredUnlessSubtleFlag returns an error with the required flag message unless the subtle flag is used.

func RequiredWithFlag

func RequiredWithFlag(ctx *cli.Context, flag, required string) error

RequiredWithFlag returns an error with the required flag message with another flag.

func RequiredWithFlagValue

func RequiredWithFlagValue(ctx *cli.Context, flag, value, required string) error

RequiredWithFlagValue returns an error with the required flag message.

func RequiredWithOrFlag

func RequiredWithOrFlag(ctx *cli.Context, withFlag string, flags ...string) error

RequiredWithOrFlag returns an error with a list of flags at least one of which is required in conjunction with the last flag in the list.

func RequiredWithProvisionerTypeFlag

func RequiredWithProvisionerTypeFlag(ctx *cli.Context, provisionerType, required string) error

RequiredWithProvisionerTypeFlag returns an error with the required flag message.

func TooFewArguments

func TooFewArguments(ctx *cli.Context) error

TooFewArguments returns an error with a few arguments were provided message.

func TooManyArguments

func TooManyArguments(ctx *cli.Context) error

TooManyArguments returns an error with a too many arguments were provided message.

func UnsupportedFlag

func UnsupportedFlag(ctx *cli.Context, flag string) error

UnsupportedFlag returns an error with a message saying that the given flag is not yet supported.

func Wrap

func Wrap(err error, format string, args ...interface{}) error

Wrap returns a new error wrapped by the given error with the given message. If the given error implements the errors.Cause interface, the base error is used. If the given error is wrapped by a package name, the error wrapped will be the string after the last colon.

Types

type FriendlyError

type FriendlyError interface {
	Message() string
}

FriendlyError is an interface for returning friendly error messages to the user.

Jump to

Keyboard shortcuts

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