github.com/nutsdb/nutsdb@v1.0.4/tx_error.go (about)

     1  package nutsdb
     2  
     3  import "errors"
     4  
     5  var (
     6  	// ErrDataSizeExceed is returned when given key and value size is too big.
     7  	ErrDataSizeExceed = errors.New("data size too big")
     8  
     9  	// ErrTxClosed is returned when committing or rolling back a transaction
    10  	// that has already been committed or rolled back.
    11  	ErrTxClosed = errors.New("tx is closed")
    12  
    13  	// ErrTxNotWritable is returned when performing a write operation on
    14  	// a read-only transaction.
    15  	ErrTxNotWritable = errors.New("tx not writable")
    16  
    17  	// ErrKeyEmpty is returned if an empty key is passed on an update function.
    18  	ErrKeyEmpty = errors.New("key cannot be empty")
    19  
    20  	// ErrBucketEmpty is returned if bucket is empty.
    21  	ErrBucketEmpty = errors.New("bucket is empty")
    22  
    23  	// ErrRangeScan is returned when range scanning not found the result
    24  	ErrRangeScan = errors.New("range scans not found")
    25  
    26  	// ErrPrefixScan is returned when prefix scanning not found the result
    27  	ErrPrefixScan = errors.New("prefix scans not found")
    28  
    29  	// ErrPrefixSearchScan is returned when prefix and search scanning not found the result
    30  	ErrPrefixSearchScan = errors.New("prefix and search scans not found")
    31  
    32  	// ErrNotFoundKey is returned when key not found int the bucket on an view function.
    33  	ErrNotFoundKey = errors.New("key not found in the bucket")
    34  
    35  	// ErrCannotCommitAClosedTx is returned when the tx committing a closed tx
    36  	ErrCannotCommitAClosedTx = errors.New("can not commit a closed tx")
    37  
    38  	// ErrCannotRollbackACommittingTx is returned when the tx rollback a committing tx
    39  	ErrCannotRollbackACommittingTx = errors.New("can not rollback a committing tx")
    40  
    41  	ErrCannotRollbackAClosedTx = errors.New("can not rollback a closed tx")
    42  
    43  	// ErrNotFoundBucket is returned when key not found int the bucket on an view function.
    44  	ErrNotFoundBucket = errors.New("bucket not found")
    45  
    46  	// ErrTxnTooBig is returned if too many writes are fit into a single transaction.
    47  	ErrTxnTooBig = errors.New("Txn is too big to fit into one request")
    48  
    49  	// ErrTxnExceedWriteLimit is returned when this tx's write is exceed max write record
    50  	ErrTxnExceedWriteLimit = errors.New("txn is exceed max write record count")
    51  
    52  	ErrBucketAlreadyExist = errors.New("bucket is already exist")
    53  
    54  	ErrorBucketNotExist = errors.New("bucket is not exist yet, please use NewBucket function to create this bucket first")
    55  
    56  	ErrValueNotInteger = errors.New("value is not an integer")
    57  
    58  	ErrOffsetInvalid = errors.New("offset is invalid")
    59  
    60  	ErrKVArgsLenNotEven = errors.New("parameters is used to represent key value pairs and cannot be odd numbers")
    61  
    62  	ErrStartGreaterThanEnd = errors.New("start is greater than end")
    63  )