LCOV - code coverage report
Current view: top level - pebble/internal/base - error.go (source / functions) Hit Total Coverage
Test: 2023-10-02 08:17Z aa077af6 - meta test only.lcov Lines: 3 8 37.5 %
Date: 2023-10-02 08:18:24 Functions: 0 0 -

          Line data    Source code
       1             : // Copyright 2011 The LevelDB-Go and Pebble Authors. All rights reserved. Use
       2             : // of this source code is governed by a BSD-style license that can be found in
       3             : // the LICENSE file.
       4             : 
       5             : package base
       6             : 
       7             : import "github.com/cockroachdb/errors"
       8             : 
       9             : // ErrNotFound means that a get or delete call did not find the requested key.
      10             : var ErrNotFound = errors.New("pebble: not found")
      11             : 
      12             : // ErrCorruption is a marker to indicate that data in a file (WAL, MANIFEST,
      13             : // sstable) isn't in the expected format.
      14             : var ErrCorruption = errors.New("pebble: corruption")
      15             : 
      16             : // MarkCorruptionError marks given error as a corruption error.
      17           0 : func MarkCorruptionError(err error) error {
      18           0 :         if errors.Is(err, ErrCorruption) {
      19           0 :                 return err
      20           0 :         }
      21           0 :         return errors.Mark(err, ErrCorruption)
      22             : }
      23             : 
      24             : // CorruptionErrorf formats according to a format specifier and returns
      25             : // the string as an error value that is marked as a corruption error.
      26           1 : func CorruptionErrorf(format string, args ...interface{}) error {
      27           1 :         return errors.Mark(errors.Newf(format, args...), ErrCorruption)
      28           1 : }

Generated by: LCOV version 1.14