mirror of
https://github.com/wader/fq.git
synced 2024-09-11 12:05:39 +03:00
leveldb: propagate error
This commit is contained in:
parent
8665df56e8
commit
e735ceadf1
@ -121,9 +121,7 @@ func readTagInternalKey(name string, d *decode.D) {
|
||||
d.FieldStruct("data", func(d *decode.D) {
|
||||
err := readInternalKey(nil, int(length), d)
|
||||
if err != nil {
|
||||
// TK(2023-12-08): how do I propagate this
|
||||
// error `err` into the `d` object?
|
||||
d.Errorf("Key read failure (size %d)", length)
|
||||
d.Errorf(err.Error())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
@ -277,9 +277,7 @@ func readKeyValueContents(
|
||||
}
|
||||
err := keyCallbackFn(keyPrefix, int(unshared), d)
|
||||
if err != nil {
|
||||
// TK(2023-12-08): how do I propagate this
|
||||
// error `err` into the `d` object?
|
||||
d.Errorf("Key read failure (size %d)", unshared)
|
||||
d.Errorf(err.Error())
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -349,7 +347,7 @@ func readInternalKey(sharedBytes []byte, unsharedSize int, d *decode.D) error {
|
||||
// ⁞
|
||||
// cutoff
|
||||
if keySize < typeAndSequenceNumberSize || int64(unsharedSize) > d.BitsLeft()/8 {
|
||||
return fmt.Errorf("invalid key size")
|
||||
return fmt.Errorf("key size %d or unshared size %d invalid", keySize, unsharedSize)
|
||||
}
|
||||
|
||||
// case 1: user_key, type, and sequence_number fit fully in unshared.
|
||||
|
Loading…
Reference in New Issue
Block a user