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
48
49
50
51
52
53
54
55
use quick_error::*;
use url::ParseError;
use crate::common::*;
use crate::serializer::SerializerError;
use crate::transport::TransportError;
quick_error! {
#[derive(Debug)]
pub enum WampError {
UnknownError(e: String) {
from()
display("Unhandled error : {}", e)
}
ConnectionError(e: TransportError) {
from()
source(e)
display("An error occured with the connection: ({})", e)
}
SerializationError(e: SerializerError) {
from()
source(e)
display("An error occured while [de]serializing a message: ({})", e)
}
InvalidUri(e: ParseError) {
source(e)
display("The uri provided could not be parsed: {}", e)
}
NoHostInUri {
display("The uri provided did not contain a host address")
}
ProtocolError(e: String) {
display("An unexpected WAMP message was received: {}", e)
}
ClientDied {
display("The client has exited without sending Shutdown")
}
RequestIdCollision {
display("There was a collision with a unique request id")
}
ServerError(uri: String, details: WampDict) {
context(uri: String, details: WampDict) -> (uri, details)
display("The server returned an error: {} {:?}", uri, details)
}
}
}