Documentation
¶
Index ¶
- Constants
- func As(err error, target any) bool
- func AsType[T error](err error) (T, bool)
- func Is(err, target error) bool
- func New(text string) error
- func Unwrap(err error) error
- type MissingVar
- type NotAllowedVar
- type TaskCalledTooManyTimesError
- type TaskCancelledByUserError
- type TaskCancelledNoTerminalError
- type TaskError
- type TaskInternalError
- type TaskMissingRequiredVarsError
- type TaskNameConflictError
- type TaskNameFlattenConflictError
- type TaskNotAllowedVarsError
- type TaskNotFoundError
- type TaskRCNotFoundError
- type TaskRunError
- type TaskTimeoutError
- type TaskfileAlreadyExistsError
- type TaskfileCacheNotFoundError
- type TaskfileCycleError
- type TaskfileDecodeError
- func (err *TaskfileDecodeError) Code() int
- func (err *TaskfileDecodeError) Debug() string
- func (err *TaskfileDecodeError) Error() string
- func (err *TaskfileDecodeError) Unwrap() error
- func (err *TaskfileDecodeError) WithFileInfo(location string, snippet string) *TaskfileDecodeError
- func (err *TaskfileDecodeError) WithMessage(format string, a ...any) *TaskfileDecodeError
- func (err *TaskfileDecodeError) WithTypeMessage(t string) *TaskfileDecodeError
- type TaskfileDoesNotMatchChecksum
- 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 CodeTaskfileDecode CodeTaskfileFetchFailed CodeTaskfileNotTrusted CodeTaskfileNotSecure CodeTaskfileCacheNotFound CodeTaskfileVersionCheckError CodeTaskfileNetworkTimeout CodeTaskfileInvalid CodeTaskfileCycle CodeTaskfileDoesNotMatchChecksum )
Taskfile related exit codes
const ( CodeTaskNotFound int = iota + 200 CodeTaskRunError CodeTaskInternal CodeTaskNameConflict CodeTaskCalledTooManyTimes CodeTaskCancelled CodeTaskMissingRequiredVars CodeTaskNotAllowedVars CodeTaskTimedOut )
Task related exit codes
const (
CodeTaskRCNotFoundError int = iota + 50
)
TaskRC related exit codes
const TimeoutExitCode = 124
TimeoutExitCode is what a killed command reports in place of the exit status it never got, following the convention of timeout(1).
Variables ¶
This section is empty.
Functions ¶
func As ¶ added in v3.30.0
As wraps the standard errors.As function so that we don't need to alias that package.
func AsType ¶ added in v3.54.0
AsType wraps the standard errors.AsType function so that we don't need to alias that package. It returns the first error in err's tree that matches type T, and whether such an error was found.
func Is ¶ added in v3.30.0
Is wraps the standard errors.Is function so that we don't need to alias that package.
Types ¶
type MissingVar ¶ added in v3.42.0
func (MissingVar) String ¶ added in v3.42.0
func (v MissingVar) String() string
type NotAllowedVar ¶ added in v3.40.0
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 ¶ added in v3.26.0
type TaskCancelledByUserError struct {
TaskName string
}
TaskCancelledByUserError is returned when the user does not accept an optional prompt to continue.
func (*TaskCancelledByUserError) Code ¶ added in v3.26.0
func (err *TaskCancelledByUserError) Code() int
func (*TaskCancelledByUserError) Error ¶ added in v3.26.0
func (err *TaskCancelledByUserError) Error() string
type TaskCancelledNoTerminalError ¶ added in v3.26.0
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 ¶ added in v3.26.0
func (err *TaskCancelledNoTerminalError) Code() int
func (*TaskCancelledNoTerminalError) Error ¶ added in v3.26.0
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 TaskMissingRequiredVarsError ¶ added in v3.42.0
type TaskMissingRequiredVarsError struct {
TaskName string
MissingVars []MissingVar
}
func (*TaskMissingRequiredVarsError) Code ¶ added in v3.42.0
func (err *TaskMissingRequiredVarsError) Code() int
func (*TaskMissingRequiredVarsError) Error ¶ added in v3.42.0
func (err *TaskMissingRequiredVarsError) 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 TaskNameFlattenConflictError ¶ added in v3.39.0
func (*TaskNameFlattenConflictError) Code ¶ added in v3.39.0
func (err *TaskNameFlattenConflictError) Code() int
func (*TaskNameFlattenConflictError) Error ¶ added in v3.39.0
func (err *TaskNameFlattenConflictError) Error() string
type TaskNotAllowedVarsError ¶ added in v3.42.0
type TaskNotAllowedVarsError struct {
TaskName string
NotAllowedVars []NotAllowedVar
}
func (*TaskNotAllowedVarsError) Code ¶ added in v3.42.0
func (err *TaskNotAllowedVarsError) Code() int
func (*TaskNotAllowedVarsError) Error ¶ added in v3.42.0
func (err *TaskNotAllowedVarsError) 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 TaskRCNotFoundError ¶ added in v3.43.0
func (TaskRCNotFoundError) Code ¶ added in v3.43.0
func (err TaskRCNotFoundError) Code() int
func (TaskRCNotFoundError) Error ¶ added in v3.43.0
func (err TaskRCNotFoundError) 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
func (*TaskRunError) Unwrap ¶ added in v3.45.5
func (err *TaskRunError) Unwrap() error
type TaskTimeoutError ¶ added in v3.53.0
TaskTimeoutError is returned when a command exceeds the timeout it declared. It must not unwrap to context.DeadlineExceeded, which --watch swallows.
func (*TaskTimeoutError) Code ¶ added in v3.53.0
func (err *TaskTimeoutError) Code() int
func (*TaskTimeoutError) Error ¶ added in v3.53.0
func (err *TaskTimeoutError) Error() string
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 ¶ added in v3.34.0
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 ¶ added in v3.34.0
func (err *TaskfileCacheNotFoundError) Code() int
func (*TaskfileCacheNotFoundError) Error ¶ added in v3.34.0
func (err *TaskfileCacheNotFoundError) Error() string
type TaskfileCycleError ¶ added in v3.37.0
TaskfileCycleError is returned when we detect that a Taskfile includes a set of Taskfiles that include each other in a cycle.
func (TaskfileCycleError) Code ¶ added in v3.37.0
func (err TaskfileCycleError) Code() int
func (TaskfileCycleError) Error ¶ added in v3.37.0
func (err TaskfileCycleError) Error() string
type TaskfileDecodeError ¶ added in v3.38.0
type TaskfileDecodeError struct {
Message string
Location string
Line int
Column int
Tag string
Snippet string
Err error
}
func NewTaskfileDecodeError ¶ added in v3.38.0
func NewTaskfileDecodeError(err error, node *yaml.Node) *TaskfileDecodeError
func (*TaskfileDecodeError) Code ¶ added in v3.38.0
func (err *TaskfileDecodeError) Code() int
func (*TaskfileDecodeError) Debug ¶ added in v3.42.0
func (err *TaskfileDecodeError) Debug() string
func (*TaskfileDecodeError) Error ¶ added in v3.38.0
func (err *TaskfileDecodeError) Error() string
func (*TaskfileDecodeError) Unwrap ¶ added in v3.38.0
func (err *TaskfileDecodeError) Unwrap() error
func (*TaskfileDecodeError) WithFileInfo ¶ added in v3.38.0
func (err *TaskfileDecodeError) WithFileInfo(location string, snippet string) *TaskfileDecodeError
func (*TaskfileDecodeError) WithMessage ¶ added in v3.38.0
func (err *TaskfileDecodeError) WithMessage(format string, a ...any) *TaskfileDecodeError
func (*TaskfileDecodeError) WithTypeMessage ¶ added in v3.38.0
func (err *TaskfileDecodeError) WithTypeMessage(t string) *TaskfileDecodeError
type TaskfileDoesNotMatchChecksum ¶ added in v3.44.0
type TaskfileDoesNotMatchChecksum struct {
URI string
ExpectedChecksum string
ActualChecksum string
}
TaskfileDoesNotMatchChecksum is returned when a Taskfile's checksum does not match the one pinned in the parent Taskfile.
func (*TaskfileDoesNotMatchChecksum) Code ¶ added in v3.44.0
func (err *TaskfileDoesNotMatchChecksum) Code() int
func (*TaskfileDoesNotMatchChecksum) Error ¶ added in v3.44.0
func (err *TaskfileDoesNotMatchChecksum) Error() string
type TaskfileFetchFailedError ¶ added in v3.30.0
TaskfileFetchFailedError is returned when no appropriate Taskfile is found when searching the filesystem.
func (TaskfileFetchFailedError) Code ¶ added in v3.30.0
func (err TaskfileFetchFailedError) Code() int
func (TaskfileFetchFailedError) Error ¶ added in v3.30.0
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 ¶ added in v3.34.0
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 ¶ added in v3.34.0
func (err *TaskfileNetworkTimeoutError) Code() int
func (*TaskfileNetworkTimeoutError) Error ¶ added in v3.34.0
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 ¶ added in v3.30.0
type TaskfileNotSecureError struct {
URI string
}
TaskfileNotSecureError is returned when the user attempts to download a remote Taskfile over an insecure connection.
func (*TaskfileNotSecureError) Code ¶ added in v3.30.0
func (err *TaskfileNotSecureError) Code() int
func (*TaskfileNotSecureError) Error ¶ added in v3.30.0
func (err *TaskfileNotSecureError) Error() string
type TaskfileNotTrustedError ¶ added in v3.30.0
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 ¶ added in v3.30.0
func (err *TaskfileNotTrustedError) Code() int
func (*TaskfileNotTrustedError) Error ¶ added in v3.30.0
func (err *TaskfileNotTrustedError) Error() string
type TaskfileVersionCheckError ¶ added in v3.34.0
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 ¶ added in v3.34.0
func (err *TaskfileVersionCheckError) Code() int
func (*TaskfileVersionCheckError) Error ¶ added in v3.34.0
func (err *TaskfileVersionCheckError) Error() string