cat_dev/fsemul/sdio/
errors.rs1use miette::Diagnostic;
4use thiserror::Error;
5
6#[derive(Diagnostic, Error, Debug, PartialEq, Eq)]
8pub enum SDIOProtocolError {
9 #[error("The SDIO client requested address: {0:02X}, but max address was: {1:02X}")]
11 #[diagnostic(code(cat_dev::net::parse::fsemul::sdio::address_out_of_range))]
12 AddressOutOfRange(u128, u128),
13 #[error("Got an invalid channel to read/write from for sdio/printf, (first byte: {0:02x} should be <0xC), (full channel: {1})")]
18 #[diagnostic(code(cat_dev::net::parse::fsemul::sdio::printf::invalid_channel))]
19 PrintfInvalidChannel(u8, u32),
20 #[error("Packet headed for SDIO PRINTF/CONTROL was size {0}, but needs to be 512 bytes")]
22 #[diagnostic(code(cat_dev::net::parse::fsemul::sdio::printf::invalid_sized_packet))]
23 PrintfInvalidSize(usize),
24 #[error("Got an unexpected sdio/printf packet type: {0}, not sure how to handle.")]
26 #[diagnostic(code(cat_dev::net::parse::fsemul::sdio::printf::unknown_packet_type))]
27 UnknownPrintfPacketType(u8),
28 #[error("Got an unexpected message fragment from an sdio printf packet type: {0}, not sure how to handle.")]
30 #[diagnostic(code(cat_dev::net::parse::fsemul::sdio::printf::unknown_message_type))]
31 UnknownPrintfMessageType(u16),
32}