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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! What a console stream operation can fail with.
use crate::ServerError;
use crate::tap::TapError;
/// A console stream operation's failure.
#[derive(Debug, thiserror::Error)]
pub enum ConsoleError {
/// A tap or feed lock was poisoned.
#[error(transparent)]
Tap(#[from] TapError),
/// Building the topology or publishing a record failed.
#[error("console {subject}: {source}")]
Server {
/// The subject being built or published.
subject: String,
/// The server's error.
#[source]
source: ServerError,
},
/// A record could not be serialised.
#[error("console {record} record could not be encoded: {source}")]
Encode {
/// Which record (`topology` or `tap.batch`).
record: &'static str,
/// The serialiser's error.
#[source]
source: serde_json::Error,
},
/// The wall clock could not give the console a time.
#[error("console clock: {reason}")]
Clock {
/// What was wrong with the reading.
reason: String,
},
/// A new tap would pass the live-tap limit (`CONSOLE_TAP_LIMIT_REFUSED`).
#[error("console tap {subject} refused: {limit} taps are live")]
TapLimit {
/// The `console.tap.<target>` subject.
subject: String,
/// The limit.
limit: usize,
},
/// The device name is empty, so `liminal.<device>` would be meaningless.
#[error("console device name is empty")]
EmptyDevice,
}