sqa_jack/
errors.rs

1use JackStatus;
2
3pub type JackResult<T> = Result<T, JackError>;
4
5#[derive(Debug, Fail)]
6pub enum JackError {
7    #[fail(display = "NUL byte in client name")]
8    NulError,
9    #[fail(display = "jack_client_open() failed")]
10    JackOpenFailed(JackStatus),
11    #[fail(display = "Programmer error: this should never happen")]
12    ProgrammerError,
13    #[fail(display = "Invalid port passed to function")]
14    InvalidPort,
15    #[fail(display = "A port matching that name could not be found.")]
16    PortNotFound,
17    #[fail(display = "Error code {} in {}", code, from)]
18    UnknownErrorCode {
19        from: &'static str,
20        code: i32
21    },
22    #[fail(display = "Could not register port (see docs for more details)")]
23    PortRegistrationFailed,
24    #[fail(display = "Invalid port passed to function: `from` must be output, `to` must be input")]
25    InvalidPortFlags,
26    #[fail(display = "Invalid port passed to function: the types of both ports must be equal")]
27    InvalidPortType,
28    #[fail(display = "This action requires the port to be owned by the client")]
29    PortNotMine,
30    #[fail(display = "The new buffer size was not a power of two.")]
31    NotPowerOfTwo,
32}