package ygo import "errors" // Common errors used throughout the ygo library. var ( // ErrNilDocument is returned when a nil document pointer is encountered. ErrNilDocument = errors.New("document pointer is nil") // ErrNilTransaction is returned when a nil transaction pointer is encountered. ErrNilTransaction = errors.New("transaction pointer is nil") // ErrNilBranch is returned when a shared type's underlying branch is nil. ErrNilBranch = errors.New("shared type branch is nil") // ErrTransactionClosed is returned when an operation is attempted on a committed or destroyed transaction. ErrTransactionClosed = errors.New("transaction has been committed or destroyed") // ErrNotWriteable is returned when a write operation is attempted on a read-only transaction. ErrNotWriteable = errors.New("transaction is not writeable") // ErrInvalidIndex is returned when an index is out of bounds. ErrInvalidIndex = errors.New("index out of bounds") // ErrKeyNotFound is returned when a key is not found in a map. ErrKeyNotFound = errors.New("key not found in map") // ErrNilWeakLink is returned when a weak link operation fails. ErrNilWeakLink = errors.New("weak link pointer is nil") // ErrInvalidUpdate is returned when an update is nil or invalid. ErrInvalidUpdate = errors.New("update is nil or invalid") // ErrInvalidStateVector is returned when a state vector is nil or invalid. ErrInvalidStateVector = errors.New("state vector is nil or invalid") // ErrIteratorExhausted is returned when iterating past the end of a collection. ErrIteratorExhausted = errors.New("iterator exhausted") // ErrSyncEndpointRequired is returned when Sync is called without an endpoint. ErrSyncEndpointRequired = errors.New("sync endpoint is required") )