-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrors.go
More file actions
37 lines (31 loc) · 1.58 KB
/
errors.go
File metadata and controls
37 lines (31 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package fmesh
import (
"errors"
)
// ErrorHandlingStrategy defines the strategy for handling errors in run-time.
type ErrorHandlingStrategy int
const (
// StopOnFirstErrorOrPanic stops the f-mesh on the first error or panic.
StopOnFirstErrorOrPanic ErrorHandlingStrategy = iota
// StopOnFirstPanic ignores errors but stops the f-mesh on first panic.
StopOnFirstPanic
// IgnoreAll allows continuing running the f-mesh regardless of how components finish their activation functions.
IgnoreAll
)
var (
// ErrHitAnErrorOrPanic is returned when f-mesh hit an error or panic and will be stopped.
ErrHitAnErrorOrPanic = errors.New("f-mesh hit an error or panic and will be stopped")
// ErrHitAPanic is returned when f-mesh hit a panic and will be stopped.
ErrHitAPanic = errors.New("f-mesh hit a panic and will be stopped")
// ErrUnsupportedErrorHandlingStrategy is returned when an unsupported error handling strategy is used.
ErrUnsupportedErrorHandlingStrategy = errors.New("unsupported error handling strategy")
// ErrReachedMaxAllowedCycles is returned when the maximum number of allowed cycles is reached.
ErrReachedMaxAllowedCycles = errors.New("reached max allowed cycles")
// ErrTimeLimitExceeded is returned when the time limit is exceeded.
ErrTimeLimitExceeded = errors.New("time limit exceeded")
errFailedToRunCycle = errors.New("failed to run cycle")
errNoComponents = errors.New("no components found")
errFailedToClearInputs = errors.New("failed to clear input ports")
// ErrFailedToDrain is returned when failed to drain.
ErrFailedToDrain = errors.New("failed to drain")
)