workflowerrors

package
v0.18.5 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxStackDepth = 50

Variables

This section is empty.

Functions

func CanRetry

func CanRetry(err error) bool

CanRetry returns true if the given error is retryable

func ToError

func ToError(err *Error) error

ToError attempts to convert the given workflow error into a regular error. It will create concrete errors for known error types and maintain the Error for unknown ones

Types

type Error

type Error struct {
	Type    string `json:"type,omitempty"`
	Message string `json:"message,omitempty"`

	Permanent  bool   `json:"permanent,omitempty"`
	Cause      error  `json:"cause,omitempty"`
	Stacktrace string `json:"stacktrace,omitempty"`
}

func FromError

func FromError(err error) *Error

FromError wraps the given error into a workflow error which can be persisted and restored

func NewPermanentError

func NewPermanentError(err error) *Error

func (*Error) Error

func (we *Error) Error() string

func (*Error) Stack

func (we *Error) Stack() string

func (*Error) UnmarshalJSON

func (e *Error) UnmarshalJSON(b []byte) error

func (*Error) Unwrap

func (we *Error) Unwrap() error

type PanicError

type PanicError struct {
	// contains filtered or unexported fields
}

func NewPanicError

func NewPanicError(msg string) *PanicError

func (*PanicError) Error

func (pe *PanicError) Error() string

func (*PanicError) Stack

func (pe *PanicError) Stack() string

Jump to

Keyboard shortcuts

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