Skip to main content

errors.go

errors.go - Overview

This file defines the custom error types used within the BadgerDB.

Error Variables

  • Purpose: Defines standard errors for BadgerDB operations.
    • ErrValueLogSize: Invalid ValueLogFileSize.
    • ErrKeyNotFound: Key not found.
    • ErrTxnTooBig: Transaction too big.
    • ErrConflict: Transaction conflict.
    • ErrReadOnlyTxn: Update on read-only transaction.
    • ErrDiscardedTxn: Re-use of discarded transaction.
    • ErrEmptyKey: Empty key passed in update function.
    • ErrInvalidKey: Key uses a reserved prefix.
    • ErrBannedKey: Key is using the banned prefix.
    • ErrThresholdZero: Value log GC called with zero threshold.
    • ErrNoRewrite: Value log GC didn't result in rewrite.
    • ErrRejected: Value log GC request rejected.
    • ErrInvalidRequest: Invalid user request.
    • ErrManagedTxn: Invalid API request in ManagedDB mode.
    • ErrNamespaceMode: API request invalid without NamespaceOffset.
    • ErrInvalidDump: Data dump cannot be read.
    • ErrZeroBandwidth: Zero bandwidth passed for sequence.
    • ErrWindowsNotSupported: Read-only mode not supported on Windows.
    • ErrPlan9NotSupported: Read-only mode not supported on Plan 9.
    • ErrTruncateNeeded: Log truncate needed due to corruption.
    • ErrBlockedWrites: Writes are blocked, possibly due to DropAll or Close.
    • ErrNilCallback: Subscriber's callback is nil.
    • ErrEncryptionKeyMismatch: Encryption key mismatch.
    • ErrInvalidDataKeyID: Invalid datakey id.
    • ErrInvalidEncryptionKey: Invalid encryption key length.
    • ErrGCInMemoryMode: Cannot run value log GC when DB is opened in InMemory mode.
    • ErrDBClosed: Get operation is performed after closing the DB.