Documentation
¶
Index ¶
Constants ¶
const FatalLevel = 12
FatalLevel specifies a custom level for fatal logging.
const TraceLevel = -8
TraceLevel specifies a custom level for trace logging.
Variables ¶
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 = &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") // 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") )
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
CheckIfFatal will return *ErrWorkflowFatal if the error is obviously unrecoverable
func Errorf ¶ added in v1.0.645
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
IsNotFound will return true if the error is a SHAR or NATS not found error type
func IsWorkflowFatal ¶ added in v0.1.172
IsWorkflowFatal is a quick test to check whether the error contains ErrWorkflowFatal
Types ¶
type ErrWorkflowFatal ¶
type ErrWorkflowFatal struct {
Err error
State *model.WorkflowState
}
ErrWorkflowFatal signifies that the workflow must terminate
func (ErrWorkflowFatal) Error ¶
func (e ErrWorkflowFatal) Error() string
Error returns the string version of the ErrWorkflowFatal error