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