Documentation
¶
Index ¶
- Constants
- func As(err error, target any) bool
- func Is(err, target error) bool
- func New(text string) error
- func Unwrap(err error) error
- type IncludeEscapesTreeError
- type MissingVar
- type NotAllowedVar
- type RitefileAlreadyExistsError
- type RitefileCycleError
- type RitefileDecodeError
- func (err *RitefileDecodeError) Code() int
- func (err *RitefileDecodeError) Debug() string
- func (err *RitefileDecodeError) Error() string
- func (err *RitefileDecodeError) Unwrap() error
- func (err *RitefileDecodeError) WithFileInfo(location string, snippet string) *RitefileDecodeError
- func (err *RitefileDecodeError) WithMessage(format string, a ...any) *RitefileDecodeError
- func (err *RitefileDecodeError) WithTypeMessage(t string) *RitefileDecodeError
- type RitefileDoesNotMatchChecksum
- type RitefileInvalidError
- type RitefileNotFoundError
- type RitefileVersionCheckError
- type RitercNotFoundError
- type TaskCalledTooManyTimesError
- type TaskCancelledByUserError
- type TaskCancelledNoTerminalError
- type TaskError
- type TaskInternalError
- type TaskMissingRequiredVarsError
- type TaskNameConflictError
- type TaskNameFlattenConflictError
- type TaskNotAllowedVarsError
- type TaskNotFoundError
- type TaskRunError
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 ( CodeRitefileNotFound int = iota + 100 CodeRitefileAlreadyExists CodeRitefileDecode CodeRitefileVersionCheckError CodeRitefileInvalid CodeRitefileCycle CodeRitefileDoesNotMatchChecksum )
Ritefile related exit codes
const ( CodeTaskNotFound int = iota + 200 CodeTaskRunError CodeTaskInternal CodeTaskNameConflict CodeTaskCalledTooManyTimes CodeTaskCancelled CodeTaskMissingRequiredVars CodeTaskNotAllowedVars )
Task related exit codes
const (
CodeRitercNotFoundError int = iota + 50
)
Riterc related exit codes
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IncludeEscapesTreeError ¶ added in v1.0.0
IncludeEscapesTreeError is returned when an `includes:` path is rejected because it would load a file from outside the sandbox: the union of the process working directory and the directory containing the root Ritefile. Includes are scoped this way so that malicious or accidental references (`/etc/passwd`, `../../../etc/hosts`, symlinks pointing outside the repo) can't cause arbitrary file reads or leak contents into error messages.
func (IncludeEscapesTreeError) Code ¶ added in v1.0.0
func (err IncludeEscapesTreeError) Code() int
func (IncludeEscapesTreeError) Error ¶ added in v1.0.0
func (err IncludeEscapesTreeError) Error() string
type MissingVar ¶
func (MissingVar) String ¶
func (v MissingVar) String() string
type NotAllowedVar ¶
type RitefileAlreadyExistsError ¶ added in v1.0.0
type RitefileAlreadyExistsError struct{}
RitefileAlreadyExistsError is returned on creating a Ritefile if one already exists.
func (RitefileAlreadyExistsError) Code ¶ added in v1.0.0
func (err RitefileAlreadyExistsError) Code() int
func (RitefileAlreadyExistsError) Error ¶ added in v1.0.0
func (err RitefileAlreadyExistsError) Error() string
type RitefileCycleError ¶ added in v1.0.0
RitefileCycleError is returned when we detect that a Ritefile includes a set of Ritefiles that include each other in a cycle.
func (RitefileCycleError) Code ¶ added in v1.0.0
func (err RitefileCycleError) Code() int
func (RitefileCycleError) Error ¶ added in v1.0.0
func (err RitefileCycleError) Error() string
type RitefileDecodeError ¶ added in v1.0.0
type RitefileDecodeError struct {
Message string
Location string
Line int
Column int
Tag string
Snippet string
Err error
}
func NewRitefileDecodeError ¶ added in v1.0.0
func NewRitefileDecodeError(err error, node *yaml.Node) *RitefileDecodeError
func (*RitefileDecodeError) Code ¶ added in v1.0.0
func (err *RitefileDecodeError) Code() int
func (*RitefileDecodeError) Debug ¶ added in v1.0.0
func (err *RitefileDecodeError) Debug() string
func (*RitefileDecodeError) Error ¶ added in v1.0.0
func (err *RitefileDecodeError) Error() string
func (*RitefileDecodeError) Unwrap ¶ added in v1.0.0
func (err *RitefileDecodeError) Unwrap() error
func (*RitefileDecodeError) WithFileInfo ¶ added in v1.0.0
func (err *RitefileDecodeError) WithFileInfo(location string, snippet string) *RitefileDecodeError
func (*RitefileDecodeError) WithMessage ¶ added in v1.0.0
func (err *RitefileDecodeError) WithMessage(format string, a ...any) *RitefileDecodeError
func (*RitefileDecodeError) WithTypeMessage ¶ added in v1.0.0
func (err *RitefileDecodeError) WithTypeMessage(t string) *RitefileDecodeError
type RitefileDoesNotMatchChecksum ¶ added in v1.0.0
type RitefileDoesNotMatchChecksum struct {
URI string
ExpectedChecksum string
ActualChecksum string
}
RitefileDoesNotMatchChecksum is returned when a Ritefile's checksum does not match the one pinned in the parent Ritefile.
func (*RitefileDoesNotMatchChecksum) Code ¶ added in v1.0.0
func (err *RitefileDoesNotMatchChecksum) Code() int
func (*RitefileDoesNotMatchChecksum) Error ¶ added in v1.0.0
func (err *RitefileDoesNotMatchChecksum) Error() string
type RitefileInvalidError ¶ added in v1.0.0
RitefileInvalidError is returned when the Ritefile contains syntax errors or cannot be parsed for some reason.
func (RitefileInvalidError) Code ¶ added in v1.0.0
func (err RitefileInvalidError) Code() int
func (RitefileInvalidError) Error ¶ added in v1.0.0
func (err RitefileInvalidError) Error() string
type RitefileNotFoundError ¶ added in v1.0.0
RitefileNotFoundError is returned when no appropriate Ritefile is found when searching the filesystem.
func (RitefileNotFoundError) Code ¶ added in v1.0.0
func (err RitefileNotFoundError) Code() int
func (RitefileNotFoundError) Error ¶ added in v1.0.0
func (err RitefileNotFoundError) Error() string
type RitefileVersionCheckError ¶ added in v1.0.0
RitefileVersionCheckError is returned when the user attempts to run a Ritefile that does not contain a schema version key or if they try to use a feature that is not supported by the schema version.
func (*RitefileVersionCheckError) Code ¶ added in v1.0.0
func (err *RitefileVersionCheckError) Code() int
func (*RitefileVersionCheckError) Error ¶ added in v1.0.0
func (err *RitefileVersionCheckError) Error() string
type RitercNotFoundError ¶ added in v1.0.0
func (RitercNotFoundError) Code ¶ added in v1.0.0
func (err RitercNotFoundError) Code() int
func (RitercNotFoundError) Error ¶ added in v1.0.0
func (err RitercNotFoundError) Error() string
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 TaskMissingRequiredVarsError ¶
type TaskMissingRequiredVarsError struct {
TaskName string
MissingVars []MissingVar
}
func (*TaskMissingRequiredVarsError) Code ¶
func (err *TaskMissingRequiredVarsError) Code() int
func (*TaskMissingRequiredVarsError) Error ¶
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 ¶
func (*TaskNameFlattenConflictError) Code ¶
func (err *TaskNameFlattenConflictError) Code() int
func (*TaskNameFlattenConflictError) Error ¶
func (err *TaskNameFlattenConflictError) Error() string
type TaskNotAllowedVarsError ¶
type TaskNotAllowedVarsError struct {
TaskName string
NotAllowedVars []NotAllowedVar
}
func (*TaskNotAllowedVarsError) Code ¶
func (err *TaskNotAllowedVarsError) Code() int
func (*TaskNotAllowedVarsError) Error ¶
func (err *TaskNotAllowedVarsError) Error() string
type TaskNotFoundError ¶
TaskNotFoundError is returned when the specified task is not found in the Ritefile.
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
func (*TaskRunError) Unwrap ¶
func (err *TaskRunError) Unwrap() error