errors

package
v1.1.2209 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const FatalLevel = 12

FatalLevel specifies a custom level for fatal logging.

View Source
const TraceLevel = -8

TraceLevel specifies a custom level for trace logging.

Variables

View Source
var (
	// ErrClosing si-gnifies SHAR server is shutting down.
	ErrClosing = errors.New("SHAR server is shutting down")
	// ErrExecutionNotFound - execution not found.
	ErrExecutionNotFound = errors.New("execution not found")
	// ErrProcessInstanceNotFound - process instance not found.
	ErrProcessInstanceNotFound = errors.New("process instance not found")
	// ErrWorkflowNotFound - workflow not found.
	ErrWorkflowNotFound = errors.New("workflow not found")
	// ErrWorkflowVersionNotFound - workflow version not found.
	ErrWorkflowVersionNotFound = errors.New("workflow version not found")
	// ErrElementNotFound - element not found.
	ErrElementNotFound = errors.New("element not found")
	// ErrStateNotFound - state not found.
	ErrStateNotFound = errors.New("state not found")
	// ErrJobNotFound - job not found.
	ErrJobNotFound = errors.New("job not found")
	// ErrMissingCorrelation - missing correllation key.
	ErrMissingCorrelation = errors.New("missing correlation key")
	// ErrFatalBadDuration - the timer embargo value could not be evaluated to an int or a duration
	ErrFatalBadDuration = &model.ErrWorkflowFatal{Err: errors.New("timer embargo value could not be evaluated to an int or a duration")}
	// ErrWorkflowErrorNotFound - the workflow error thrown is not recognised.
	ErrWorkflowErrorNotFound = errors.New("workflow error number not found")
	// ErrUndefinedVariable - a variable was referred to in the workflow that hasn't been declared.
	ErrUndefinedVariable = errors.New("undefined variable")
	// ErrMissingErrorCode - no workflow error code was provided.
	ErrMissingErrorCode = errors.New("missing error code")
	// ErrBadlyQuotedIdentifier - an identifier was not correctgly formatted.
	ErrBadlyQuotedIdentifier = errors.New("identifier not correctly quoted")
	// ErrMessageSenderAlreadyRegistered - a message sender with this signature was already registered.
	ErrMessageSenderAlreadyRegistered = errors.New("message sender already registered")
	// ErrServiceTaskAlreadyRegistered - a service task with this signature was already registered.
	ErrServiceTaskAlreadyRegistered = errors.New("service task already registered")
	// ErrFailedToParseISO8601 - string cound not be parsed into an ISO 8601 duration.
	ErrFailedToParseISO8601 = errors.New("parse Duration string")
	// ErrBadTimerEventDefinition - no timer defined of a timer event.
	ErrBadTimerEventDefinition = errors.New("found timerEventDefinition, but it had no time or Duration specified")
	// ErrBadTimeCycle - time cycle was not specified correctly.
	ErrBadTimeCycle = errors.New("time cycle was not in the correct format")
	// ErrCorrelationFail - could not correlate the workflow message.
	ErrCorrelationFail = errors.New("find correlation message")
	// ErrMissingID - could not validate the id in the model
	ErrMissingID = errors.New("missing id")
	// ErrMissingServiceTaskDefinition - could not find the definition for the service task.
	ErrMissingServiceTaskDefinition = errors.New("missing service task definition")
	// ErrExtractingVar - failod to extract client variable.
	ErrExtractingVar = errors.New("extract var")
	// ErrExpectedVar - a variable was expected by workflow that was not provided.
	ErrExpectedVar = errors.New("workflow expects variable")
	// ErrVarTypeMismatch - a variable was provided, but the type was incorrect.
	ErrVarTypeMismatch = errors.New("workflow variable type mismatch")
	// ErrCancelFailed - an attempt to cancel a workflow instance failed.
	ErrCancelFailed = errors.New("cancel workflow instance")
	// ErrInvalidState - an attempt was made to p[erform an action witrh an invalid cancellation state.
	ErrInvalidState = errors.New("invalid cancellation state")
	// ErrApiAuthZFail - an attempt was made to call an API that failed an authorization check.
	ErrApiAuthZFail = errors.New("authorize API call")
	// ErrApiAuthNFail - an attempt was made to call an API that failed an authentication check.
	ErrApiAuthNFail = errors.New("authenticate API call")
	// ErrLint - linter returned errors.
	ErrLint = errors.New("linter returned errors")
	// ErrGatewayInstanceNotFound - failed to find gateway instance.
	ErrGatewayInstanceNotFound = errors.New("find gateway instance")
	// ErrProcessNotFound - failed to find process.
	ErrProcessNotFound = errors.New("process not found")
	// ErrDeprecateServiceTaskInUse - the service task is in use.
	ErrDeprecateServiceTaskInUse = errors.New("attempt to deprecate service task in use")
	// ErrTaskLocked signifies that the task is already locked and cannot be accessed or modified.
	ErrTaskLocked = errors.New("task is locked")
	// ErrTaskNotOpen is returned when an operation is attempted on a task that is not in an open state.
	ErrTaskNotOpen = errors.New("task is not open")
)
View Source
var ErrUnhandledWorkflowError = errors.New("unhandled workflow error")

ErrUnhandledWorkflowError indicates a workflow error code that cannot be handled by the workflow.

Functions

func CheckIfFatal added in v1.0.645

func CheckIfFatal(err error) error

CheckIfFatal will return *model.ErrWorkflowFatal if the error is obviously unrecoverable

func Errorf added in v1.0.645

func Errorf(format string, a ...any) error

Errorf will return a formatted error, marking it fatal if the error is obviously unrecoverable

func Fn added in v1.0.446

func Fn() string

Fn - obtains the calling function for use in error handling. ** CAUTION - This is inefficient, and should only be used for fatal errors and errors that are not expected to occur during normal operation **

func IsNotFound added in v1.0.645

func IsNotFound(err error) bool

IsNotFound will return true if the error is a SHAR or NATS not found error type

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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