Documentation ¶
Index ¶
- Constants
- func As(err error, target any) bool
- func Is(err, target error) bool
- func New(text string) error
- type TaskCalledTooManyTimesError
- type TaskCancelledByUserError
- type TaskCancelledNoTerminalError
- type TaskError
- type TaskInternalError
- type TaskMissingRequiredVars
- type TaskNameConflictError
- type TaskNotFoundError
- type TaskRunError
- type TaskfileAlreadyExistsError
- type TaskfileCacheNotFoundError
- type TaskfileFetchFailedError
- type TaskfileInvalidError
- type TaskfileNetworkTimeoutError
- type TaskfileNotFoundError
- type TaskfileNotSecureError
- type TaskfileNotTrustedError
- type TaskfileVersionCheckError
Constants ¶
const ( CodeOk int = iota // Used when the program exits without errors CodeUnknown // Used when no other exit code is appropriate )
General exit codes
const ( CodeTaskfileNotFound int = iota + 100 CodeTaskfileAlreadyExists CodeTaskfileInvalid CodeTaskfileFetchFailed CodeTaskfileNotTrusted CodeTaskfileNotSecure CodeTaskfileCacheNotFound CodeTaskfileVersionCheckError CodeTaskfileNetworkTimeout )
Taskfile related exit codes
const ( CodeTaskNotFound int = iota + 200 CodeTaskRunError CodeTaskInternal CodeTaskNameConflict CodeTaskCalledTooManyTimes CodeTaskCancelled CodeTaskMissingRequiredVars )
Task related exit codes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type TaskCalledTooManyTimesError ¶
TaskCalledTooManyTimesError is returned when the maximum task call limit is exceeded. This is to prevent infinite loops and cyclic dependencies.
func (*TaskCalledTooManyTimesError) Code ¶
func (err *TaskCalledTooManyTimesError) Code() int
func (*TaskCalledTooManyTimesError) Error ¶
func (err *TaskCalledTooManyTimesError) Error() string
type TaskCancelledByUserError ¶
type TaskCancelledByUserError struct {
TaskName string
}
TaskCancelledByUserError is returned when the user does not accept an optional prompt to continue.
func (*TaskCancelledByUserError) Code ¶
func (err *TaskCancelledByUserError) Code() int
func (*TaskCancelledByUserError) Error ¶
func (err *TaskCancelledByUserError) Error() string
type TaskCancelledNoTerminalError ¶
type TaskCancelledNoTerminalError struct {
TaskName string
}
TaskCancelledNoTerminalError is returned when trying to run a task with a prompt in a non-terminal environment.
func (*TaskCancelledNoTerminalError) Code ¶
func (err *TaskCancelledNoTerminalError) Code() int
func (*TaskCancelledNoTerminalError) Error ¶
func (err *TaskCancelledNoTerminalError) Error() string
type TaskError ¶
TaskError extends the standard error interface with a Code method. This code will be used as the exit code of the program which allows the user to distinguish between different types of errors.
type TaskInternalError ¶
type TaskInternalError struct {
TaskName string
}
TaskInternalError when the user attempts to invoke a task that is internal.
func (*TaskInternalError) Code ¶
func (err *TaskInternalError) Code() int
func (*TaskInternalError) Error ¶
func (err *TaskInternalError) Error() string
type TaskMissingRequiredVars ¶
TaskMissingRequiredVars is returned when a task is missing required variables.
func (*TaskMissingRequiredVars) Code ¶
func (err *TaskMissingRequiredVars) Code() int
func (*TaskMissingRequiredVars) Error ¶
func (err *TaskMissingRequiredVars) Error() string
type TaskNameConflictError ¶
TaskNameConflictError is returned when multiple tasks with a matching name or alias are found.
func (*TaskNameConflictError) Code ¶
func (err *TaskNameConflictError) Code() int
func (*TaskNameConflictError) Error ¶
func (err *TaskNameConflictError) Error() string
type TaskNotFoundError ¶
TaskNotFoundError is returned when the specified task is not found in the Taskfile.
func (*TaskNotFoundError) Code ¶
func (err *TaskNotFoundError) Code() int
func (*TaskNotFoundError) Error ¶
func (err *TaskNotFoundError) Error() string
type TaskRunError ¶
TaskRunError is returned when a command in a task returns a non-zero exit code.
func (*TaskRunError) Code ¶
func (err *TaskRunError) Code() int
func (*TaskRunError) Error ¶
func (err *TaskRunError) Error() string
func (*TaskRunError) TaskExitCode ¶
func (err *TaskRunError) TaskExitCode() int
type TaskfileAlreadyExistsError ¶
type TaskfileAlreadyExistsError struct{}
TaskfileAlreadyExistsError is returned on creating a Taskfile if one already exists.
func (TaskfileAlreadyExistsError) Code ¶
func (err TaskfileAlreadyExistsError) Code() int
func (TaskfileAlreadyExistsError) Error ¶
func (err TaskfileAlreadyExistsError) Error() string
type TaskfileCacheNotFoundError ¶
type TaskfileCacheNotFoundError struct {
URI string
}
TaskfileCacheNotFoundError is returned when the user attempts to use an offline (cached) Taskfile but the files does not exist in the cache.
func (*TaskfileCacheNotFoundError) Code ¶
func (err *TaskfileCacheNotFoundError) Code() int
func (*TaskfileCacheNotFoundError) Error ¶
func (err *TaskfileCacheNotFoundError) Error() string
type TaskfileFetchFailedError ¶
TaskfileFetchFailedError is returned when no appropriate Taskfile is found when searching the filesystem.
func (TaskfileFetchFailedError) Code ¶
func (err TaskfileFetchFailedError) Code() int
func (TaskfileFetchFailedError) Error ¶
func (err TaskfileFetchFailedError) Error() string
type TaskfileInvalidError ¶
TaskfileInvalidError is returned when the Taskfile contains syntax errors or cannot be parsed for some reason.
func (TaskfileInvalidError) Code ¶
func (err TaskfileInvalidError) Code() int
func (TaskfileInvalidError) Error ¶
func (err TaskfileInvalidError) Error() string
type TaskfileNetworkTimeoutError ¶
TaskfileNetworkTimeoutError is returned when the user attempts to use a remote Taskfile but a network connection could not be established within the timeout.
func (*TaskfileNetworkTimeoutError) Code ¶
func (err *TaskfileNetworkTimeoutError) Code() int
func (*TaskfileNetworkTimeoutError) Error ¶
func (err *TaskfileNetworkTimeoutError) Error() string
type TaskfileNotFoundError ¶
TaskfileNotFoundError is returned when no appropriate Taskfile is found when searching the filesystem.
func (TaskfileNotFoundError) Code ¶
func (err TaskfileNotFoundError) Code() int
func (TaskfileNotFoundError) Error ¶
func (err TaskfileNotFoundError) Error() string
type TaskfileNotSecureError ¶
type TaskfileNotSecureError struct {
URI string
}
TaskfileNotSecureError is returned when the user attempts to download a remote Taskfile over an insecure connection.
func (*TaskfileNotSecureError) Code ¶
func (err *TaskfileNotSecureError) Code() int
func (*TaskfileNotSecureError) Error ¶
func (err *TaskfileNotSecureError) Error() string
type TaskfileNotTrustedError ¶
type TaskfileNotTrustedError struct {
URI string
}
TaskfileNotTrustedError is returned when the user does not accept the trust prompt when downloading a remote Taskfile.
func (*TaskfileNotTrustedError) Code ¶
func (err *TaskfileNotTrustedError) Code() int
func (*TaskfileNotTrustedError) Error ¶
func (err *TaskfileNotTrustedError) Error() string
type TaskfileVersionCheckError ¶
TaskfileVersionCheckError is returned when the user attempts to run a Taskfile that does not contain a Taskfile schema version key or if they try to use a feature that is not supported by the schema version.
func (*TaskfileVersionCheckError) Code ¶
func (err *TaskfileVersionCheckError) Code() int
func (*TaskfileVersionCheckError) Error ¶
func (err *TaskfileVersionCheckError) Error() string