-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherror.go
33 lines (28 loc) · 1.2 KB
/
error.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
30
31
32
33
package hippo
// Params errors.
const (
ErrParamsIDRequired = Error("parameter id required")
ErrNotImplemented = Error("feature not implemented")
)
// Event errors.
const (
ErrAggregateIDCanNotBeEmpty = Error("aggregateID can not be empty")
ErrBufferCanNotBeNil = Error("buffer can not be nil")
ErrFormatNotProvided = Error("format is not provided")
ErrConcurrencyException = Error("concurrency exception")
ErrAggregateIDWithoutEvents = Error("aggregateID without events")
ErrEmptyState = Error("aggregate with empty state")
ErrInvalidEventFormat = Error("event data is not encoded in the right format")
ErrInvalidSchema = Error("invalid schema schema to decode event data")
)
// Cache errors.
const (
ErrCacheServiceNotConfigured = Error("cache service is not configured")
ErrKeyDoesNotExist = Error("key does not exist")
ErrVersionFieldDoesNotExist = Error("invalid aggregate key - version field does not exist")
ErrStateFieldDoesNotExist = Error("invalid aggregate key - state field does not exist")
)
// Error represents a HIPPO error.
type Error string
// Error returns the error message.
func (e Error) Error() string { return string(e) }