use dynomite::embed::DatastoreError;
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum RiakError {
#[error("io: {0}")]
Io(#[from] std::io::Error),
#[error("frame too large: announced {announced} bytes, maximum {max} bytes")]
FrameTooLarge {
announced: u32,
max: u32,
},
#[error("empty frame: zero-length PBC frames are not allowed")]
EmptyFrame,
#[error("connection closed mid-frame ({read} of {expected} bytes read)")]
UnexpectedEof {
read: usize,
expected: usize,
},
#[error("unknown PBC message code: {0}")]
UnknownMessageCode(u8),
#[error("protobuf decode: {0}")]
Decode(#[from] prost::DecodeError),
#[error("protobuf encode: {0}")]
Encode(#[from] prost::EncodeError),
#[error("datastore: {0}")]
Datastore(#[from] DatastoreError),
}