mirror of
https://github.com/logos-messaging/libchat.git
synced 2026-02-10 00:43:09 +00:00
* Adds final changes for rust side API * Add Safer_ffi impl * Simplify api * Add const handle offset
22 lines
720 B
Rust
22 lines
720 B
Rust
pub use thiserror::Error;
|
|
|
|
#[derive(Error, Debug)]
|
|
pub enum ChatError {
|
|
#[error("protocol error: {0:?}")]
|
|
Protocol(String),
|
|
#[error("protocol error: Got {0:?} expected {1:?}")]
|
|
ProtocolExpectation(&'static str, String),
|
|
#[error("Failed to decode payload: {0}")]
|
|
DecodeError(#[from] prost::DecodeError),
|
|
#[error("incorrect bundle value: {0:?}")]
|
|
UnexpectedPayload(String),
|
|
#[error("unexpected payload contents: {0}")]
|
|
BadBundleValue(String),
|
|
#[error("handshake initiated with a unknown ephemeral key")]
|
|
UnknownEphemeralKey(),
|
|
#[error("expected a different key length")]
|
|
InvalidKeyLength,
|
|
#[error("bytes provided to {0} failed")]
|
|
BadParsing(&'static str),
|
|
}
|