github.com/zuoyebang/bitalosdb@v1.1.1-0.20240516111551-79a8c4d8ce20/bitree/bdb/errors.go (about)

     1  // Copyright 2021 The Bitalosdb author(hustxrb@163.com) and other contributors.
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package bdb
    16  
    17  import "errors"
    18  
    19  var (
    20  	ErrDatabaseNotOpen = errors.New("database not open")
    21  	ErrDatabaseOpen    = errors.New("database already open")
    22  	ErrInvalid         = errors.New("invalid database")
    23  	ErrVersionMismatch = errors.New("version mismatch")
    24  	ErrChecksum        = errors.New("checksum error")
    25  	ErrTimeout         = errors.New("timeout")
    26  )
    27  
    28  var (
    29  	ErrTxNotWritable    = errors.New("tx not writable")
    30  	ErrTxClosed         = errors.New("tx closed")
    31  	ErrDatabaseReadOnly = errors.New("database is in read-only mode")
    32  )
    33  
    34  var (
    35  	ErrBucketNotFound     = errors.New("bucket not found")
    36  	ErrBucketExists       = errors.New("bucket already exists")
    37  	ErrBucketNameRequired = errors.New("bucket name required")
    38  	ErrKeyRequired        = errors.New("key required")
    39  	ErrKeyTooLarge        = errors.New("key too large")
    40  	ErrValueTooLarge      = errors.New("value too large")
    41  	ErrIncompatibleValue  = errors.New("incompatible value")
    42  )