#[non_exhaustive]pub enum ErrorCode {
Show 28 variants
Io,
Sqlite,
NotAFile,
TooLarge,
FileLength,
Schema,
Identity,
FreePages,
Meta,
Profile,
String,
StringIds,
Plane,
Zone,
Anchor,
Stairwell,
StairwellStep,
Definition,
Chunk,
ChunkEncoding,
ChunkData,
ChunkRecord,
Reference,
ObjectUid,
Integrity,
Digest,
DecodeBudget,
Invalid,
}Expand description
Stable codes for why a pack failed to open, read or verify, one per rule
of docs/spec/PACK.md section 3. The Go reader reports the same codes,
and the conformance fixtures in fixtures/packs pin them.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io
The file could not be read.
Sqlite
SQLite failed, for example on a file that is not a database.
NotAFile
The path is not a regular file.
TooLarge
The file is longer than the pack size limit.
FileLength
The file is not exactly its pages.
Schema
The schema is not exactly the format’s.
Identity
The application ID, user version or page size is not the format’s, or the SQLite header’s file format versions are not 1.
FreePages
The pack has free pages.
Meta
meta does not hold exactly the format’s keys and values.
Profile
The stored profile is invalid or disagrees with meta.
String
A string is not UTF-8 text of at most 1 MiB without NUL.
StringIds
String IDs are not 1..=count in byte order of their values.
Plane
A plane row or document is invalid.
Zone
A zone row or document is invalid, or zone parents form a cycle.
Anchor
An anchor row is invalid.
Stairwell
A stairwell row or document is invalid or disagrees with its steps.
StairwellStep
A stairwell_steps row is invalid or listed by no stairwell.
Definition
A definition row or document is invalid.
Chunk
A chunk row’s key is invalid, or its record disagrees with its plane or the profile.
ChunkEncoding
A chunk’s encoding is not twc1+zstd.
ChunkData
A chunk’s data is not a blob within the encoding’s bound.
ChunkRecord
A chunk’s data is not a valid twc1+zstd record.
Reference
A chunk record names a target that does not exist or is out of range.
ObjectUid
An object_uids row is invalid, or the table does not index exactly
the uids of the chunk records.
Integrity
SQLite’s integrity check failed.
Digest
The file’s SHA-256 does not match its name, or the SHA-256 of a pack opened from bytes is not the digest its caller expects.
DecodeBudget
The chunks decode to more than the verification budget, or a single read holds more than its budget: a chunk’s objects and fields, or, in the browser reader, a stairwell’s steps.
Invalid
The compiler cannot encode a world.