BREAKING CHANGE(core): replace the TypeScript database engine with a Rust-backed embedded server and bridge
This commit is contained in:
27
rust/crates/rustdb-wire/src/error.rs
Normal file
27
rust/crates/rustdb-wire/src/error.rs
Normal file
@@ -0,0 +1,27 @@
|
||||
/// Errors from wire protocol parsing/encoding.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum WireError {
|
||||
#[error("Incomplete message: need {needed} bytes, have {have}")]
|
||||
Incomplete { needed: usize, have: usize },
|
||||
|
||||
#[error("Unsupported opCode: {0}")]
|
||||
UnsupportedOpCode(i32),
|
||||
|
||||
#[error("Missing command body section in OP_MSG")]
|
||||
MissingBody,
|
||||
|
||||
#[error("Unknown section type: {0}")]
|
||||
UnknownSectionType(u8),
|
||||
|
||||
#[error("BSON deserialization error: {0}")]
|
||||
BsonError(#[from] bson::de::Error),
|
||||
|
||||
#[error("BSON serialization error: {0}")]
|
||||
BsonSerError(#[from] bson::ser::Error),
|
||||
|
||||
#[error("IO error: {0}")]
|
||||
IoError(#[from] std::io::Error),
|
||||
|
||||
#[error("Checksum mismatch: expected {expected}, got {actual}")]
|
||||
ChecksumMismatch { expected: u32, actual: u32 },
|
||||
}
|
||||
Reference in New Issue
Block a user