cli

package
v0.0.0-...-fb69fc5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleErrorAndExit

func HandleErrorAndExit(err error)

HandleErrorAndExit can wrap all top level command functions. Note: HandleErrorAndExit does not print 'Usage' Example: HandleErrorAndExit(logOut())

Types

type CancelError

type CancelError struct{}

CancelError is thrown when an action is cancelled by the User. Does not display a message. Exits with code 0.

func (*CancelError) Error

func (e *CancelError) Error() string

type Error

type Error interface {
	Error() string
	// contains filtered or unexported methods
}

Error must implemented by all cli errors in this package

func TransformSurveyError

func TransformSurveyError(err error) Error

TransformSurveyError transforms a survey/v2 error to an cli.Error

type InternalError

type InternalError struct {
	// The actual error
	Err error

	// User-friendly message to print to the user
	// instead of the actual error
	Message string
}

InternalError implements a cli.Error that cannot be be used to log an internal error and print a user-friendly message to the CLI user.

func (*InternalError) Error

func (e *InternalError) Error() string

type NotLoggedInError

type NotLoggedInError struct{}

NotLoggedInError is thrown when the user is not logged into the CLI

func (*NotLoggedInError) Error

func (e *NotLoggedInError) Error() string

type UserError

type UserError struct{ Message string }

UserError implements a cli.Error that can be safely printed to the console without leaking implementation details.

func (*UserError) Error

func (e *UserError) Error() string

Jump to

Keyboard shortcuts

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