errtypes

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package errtypes owns engine error values without activity or workflow dependencies. Applications use the aliases and constructors exposed by package engine.

Index

Constants

This section is empty.

Variables

View Source
var ErrCanceled = context.Canceled

ErrCanceled marks engine cancellation. It shares context.Canceled's identity so existing context cancellation checks and exact-leaf classification keep working. Engines must surface this marker for canceled activities, workflows and timers.

Functions

func IsCanceled

func IsCanceled(err error) bool

IsCanceled reports whether err carries the engine cancellation marker. Mixed error graphs require the runtime's exact-leaf classifier to decide run status.

func IsTimeout

func IsTimeout(err error) bool

IsTimeout reports an engine timeout or a native context deadline.

Types

type ApplicationError

type ApplicationError struct {
	Type         string
	Message      string
	NonRetryable bool
	Details      any
	Cause        error
}

ApplicationError carries a portable activity or workflow failure. Every engine must stop retrying an activity that returns an ApplicationError with NonRetryable set. Activity and workflow failures surfaced to workflow code must carry these engine types so errors.As can inspect them in the runtime. Details is a single serializable value; Cause retains the underlying failure.

func NewApplicationError

func NewApplicationError(message, errorType string, details any, cause error) *ApplicationError

NewApplicationError constructs a retryable application failure.

func NewNonRetryableApplicationError

func NewNonRetryableApplicationError(message, errorType string, details any, cause error) *ApplicationError

NewNonRetryableApplicationError constructs a failure that must not be retried.

func (*ApplicationError) Error

func (e *ApplicationError) Error() string

Error returns the application failure message.

func (*ApplicationError) Unwrap

func (e *ApplicationError) Unwrap() error

Unwrap returns the underlying application failure.

type TimeoutError

type TimeoutError struct {
	Cause error
}

TimeoutError marks an engine execution timeout and retains its underlying cause. Engines must surface this type to workflow code for execution timeouts.

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

Error returns the underlying timeout message, or a stable default.

func (*TimeoutError) Unwrap

func (e *TimeoutError) Unwrap() error

Unwrap returns the underlying timeout failure.

Jump to

Keyboard shortcuts

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