Skip to main content

rill_osc/
error.rs

1use std::io;
2
3use thiserror::Error;
4
5/// Errors that can occur during OSC encoding, decoding, or I/O.
6#[derive(Error, Debug)]
7pub enum Error {
8    /// Generic parse error with a description message.
9    #[error("OSC parse error: {0}")]
10    Parse(String),
11
12    /// Wraps an underlying I/O error.
13    #[error("I/O error: {0}")]
14    Io(#[from] io::Error),
15
16    /// The packet does not match any known OSC format.
17    #[error("invalid OSC packet")]
18    InvalidPacket,
19
20    /// Type tag mismatch between expected and actual types.
21    #[error("type mismatch: expected {expected}, got {actual}")]
22    TypeMismatch {
23        /// The expected type description.
24        expected: String,
25        /// The actual type description.
26        actual: String,
27    },
28}