errors.go

 1package ygo
 2
 3import "errors"
 4
 5// Common errors used throughout the ygo library.
 6var (
 7	// ErrNilDocument is returned when a nil document pointer is encountered.
 8	ErrNilDocument = errors.New("document pointer is nil")
 9
10	// ErrNilTransaction is returned when a nil transaction pointer is encountered.
11	ErrNilTransaction = errors.New("transaction pointer is nil")
12
13	// ErrNilBranch is returned when a shared type's underlying branch is nil.
14	ErrNilBranch = errors.New("shared type branch is nil")
15
16	// ErrTransactionClosed is returned when an operation is attempted on a committed or destroyed transaction.
17	ErrTransactionClosed = errors.New("transaction has been committed or destroyed")
18
19	// ErrNotWriteable is returned when a write operation is attempted on a read-only transaction.
20	ErrNotWriteable = errors.New("transaction is not writeable")
21
22	// ErrInvalidIndex is returned when an index is out of bounds.
23	ErrInvalidIndex = errors.New("index out of bounds")
24
25	// ErrKeyNotFound is returned when a key is not found in a map.
26	ErrKeyNotFound = errors.New("key not found in map")
27
28	// ErrNilWeakLink is returned when a weak link operation fails.
29	ErrNilWeakLink = errors.New("weak link pointer is nil")
30
31	// ErrInvalidUpdate is returned when an update is nil or invalid.
32	ErrInvalidUpdate = errors.New("update is nil or invalid")
33
34	// ErrInvalidStateVector is returned when a state vector is nil or invalid.
35	ErrInvalidStateVector = errors.New("state vector is nil or invalid")
36
37	// ErrIteratorExhausted is returned when iterating past the end of a collection.
38	ErrIteratorExhausted = errors.New("iterator exhausted")
39
40	// ErrSyncEndpointRequired is returned when Sync is called without an endpoint.
41	ErrSyncEndpointRequired = errors.New("sync endpoint is required")
42)