def codec_error

mylsm-lsm-store@0.6.0.1 · src/SstStreamIo.bend:17

import mylsm-lsm-store@0.6.0.1/src/SstStreamIo.bend as SstStreamIo
import Base
import mylsm-lsm-store@0.6.0.1/src/SstFile.bend as SstFile

17# Map pure format errors to the storage IO error domain.
18def codec_error(error: SstFile.Error) -> U32 & String:
19  match error:
20    case SstFile.InvalidLevel{}:
21      (corruption_error_code(), "invalid SST level")
22    case SstFile.InvalidOrder{}:
23      (corruption_error_code(), "SST keys are not strictly ordered")
24    case SstFile.TooLarge{}:
25      (corruption_error_code(), "SST exceeds a size limit")
26    case SstFile.Malformed{}:
27      (corruption_error_code(), "malformed v3 SST")
28    case SstFile.InvalidUtf8{}:
29      (corruption_error_code(), "invalid UTF-8 in v3 SST")
30    case SstFile.ChecksumMismatch{}:
31      (corruption_error_code(), "v3 SST checksum mismatch")

Uses (6)

Used by (4)