exitcode

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package exitcode defines the stable exit-code contract for the tkn-act CLI and provides a small error-wrapper that lets command implementations associate an error with a specific code without coupling them to the main package.

The codes are part of tkn-act's public contract for AI agents and shell scripts; do not renumber them. New categories should append rather than reuse.

Index

Constants

View Source
const (
	OK        = 0   // success
	Generic   = 1   // unexpected / uncategorized error
	Usage     = 2   // bad flags, contradictory inputs, missing required arg
	Env       = 3   // environment is missing a dependency (Docker, k3d, ...)
	Validate  = 4   // Tekton YAML rejected before run
	Pipeline  = 5   // a Task or finally task failed during run
	Timeout   = 6   // a Task or finally task ended due to its declared timeout
	Cancelled = 130 // SIGINT / SIGTERM
)

Variables

This section is empty.

Functions

func From

func From(err error) int

From returns the exit code that should be used for err.

  • nil -> OK
  • *Error -> its Code
  • anything else -> Generic

func Wrap

func Wrap(code int, err error) error

Wrap attaches the given exit code to err. Returns nil if err is nil.

Types

type Error

type Error struct {
	Code int
	Err  error
}

Error wraps an underlying error with a CLI exit code.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

Jump to

Keyboard shortcuts

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