openbutler_protocol/
error.rs1#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
6pub enum FrameError {
7 #[error("IPC frame exceeded the 32 MB limit.")]
9 ExceededLimit,
10}
11
12#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
14pub enum ValidationError {
15 #[error("Unsupported protocol version {actual}; this host speaks {expected}.")]
17 WrongVersion { expected: u32, actual: u32 },
18 #[error("Request id must be 1-64 characters, got {actual}.")]
20 InvalidIdLength { actual: usize },
21 #[error("Action must be 1-64 characters, got {actual}.")]
23 InvalidActionLength { actual: usize },
24 #[error("Response version {actual} does not echo the requested version {expected}.")]
26 ResponseVersionMismatch { expected: u32, actual: u32 },
27 #[error("Response carries neither a result nor an error.")]
29 MalformedResponse,
30 #[error("IPC frame exceeded the JSON structure budget.")]
32 JsonBudget,
33 #[error("{name} must be a non-empty string under {max_bytes} bytes.")]
36 PayloadString {
37 name: &'static str,
38 max_bytes: usize,
39 },
40 #[error("{name} must be an integer between {min} and {max}.")]
43 PayloadInteger {
44 name: &'static str,
45 min: u64,
46 max: u64,
47 },
48}