-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.go
29 lines (23 loc) · 1.06 KB
/
errors.go
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
package fmesh
import (
"errors"
)
type ErrorHandlingStrategy int
const (
// StopOnFirstErrorOrPanic stops the f-mesh on first error or panic
StopOnFirstErrorOrPanic ErrorHandlingStrategy = iota
// StopOnFirstPanic ignores errors, but stops the f-mesh on first panic
StopOnFirstPanic
// IgnoreAll allows to continue running the f-mesh regardless of how components finish their activation functions
IgnoreAll
)
var (
ErrHitAnErrorOrPanic = errors.New("f-mesh hit an error or panic and will be stopped")
ErrHitAPanic = errors.New("f-mesh hit a panic and will be stopped")
ErrUnsupportedErrorHandlingStrategy = errors.New("unsupported error handling strategy")
ErrReachedMaxAllowedCycles = errors.New("reached max allowed cycles")
errFailedToRunCycle = errors.New("failed to run cycle")
errNoComponents = errors.New("no components found")
errFailedToClearInputs = errors.New("failed to clear input ports")
ErrFailedToDrain = errors.New("failed to drain")
)