webrtc_stun/
errors.rs

1use util::Error;
2
3lazy_static! {
4    // ErrAttributeNotFound means that attribute with provided attribute
5    // type does not exist in message.
6    pub static ref ERR_ATTRIBUTE_NOT_FOUND: Error = Error::new("attribute not found".to_owned());
7    // ErrTransactionStopped indicates that transaction was manually stopped.
8    pub static ref ERR_TRANSACTION_STOPPED: Error = Error::new("transaction is stopped".to_owned());
9    // ErrTransactionNotExists indicates that agent failed to find transaction.
10    pub static ref ERR_TRANSACTION_NOT_EXISTS: Error = Error::new("transaction not exists".to_owned());
11    // ErrTransactionExists indicates that transaction with same id is already
12    // registered.
13    pub static ref ERR_TRANSACTION_EXISTS: Error = Error::new("transaction exists with same id".to_owned());
14    // ErrAgentClosed indicates that agent is in closed state and is unable
15    // to handle transactions.
16    pub static ref ERR_AGENT_CLOSED: Error = Error::new("agent is closed".to_owned());
17    // ErrTransactionTimeOut indicates that transaction has reached deadline.
18    pub static ref ERR_TRANSACTION_TIME_OUT: Error = Error::new("transaction is timed out".to_owned());
19    // ErrNoDefaultReason means that default reason for provided error code
20    // is not defined in RFC.
21    pub static ref ERR_NO_DEFAULT_REASON: Error = Error::new("no default reason for ErrorCode".to_owned());
22    pub static ref ERR_UNEXPECTED_EOF: Error = Error::new("unexpected EOF".to_owned());
23    // ErrAttributeSizeInvalid means that decoded attribute size is invalid.
24    pub static ref ERR_ATTRIBUTE_SIZE_INVALID: Error = Error::new("attribute size is invalid".to_owned());
25    // ErrAttributeSizeOverflow means that decoded attribute size is too big.
26    pub static ref ERR_ATTRIBUTE_SIZE_OVERFLOW: Error = Error::new("attribute size overflow".to_owned());
27    // ErrDecodeToNil occurs on Decode(data, nil) call.
28    pub static ref ERR_DECODE_TO_NIL: Error = Error::new("attempt to decode to nil message".to_owned());
29    // ErrUnexpectedHeaderEOF means that there were not enough bytes in Raw to read header.
30    pub static ref ERR_UNEXPECTED_HEADER_EOF: Error = Error::new("unexpected EOF: not enough bytes to read header".to_owned());
31    // ErrIntegrityMismatch means that computed HMAC differs from expected.
32    pub static ref ERR_INTEGRITY_MISMATCH: Error = Error::new("integrity check failed".to_owned());
33    // ErrFingerprintMismatch means that computed fingerprint differs from expected.
34    pub static ref ERR_FINGERPRINT_MISMATCH: Error = Error::new("fingerprint check failed".to_owned());
35    // ErrFingerprintBeforeIntegrity means that FINGERPRINT attribute is already in
36    // message, so MESSAGE-INTEGRITY attribute cannot be added.
37    pub static ref ERR_FINGERPRINT_BEFORE_INTEGRITY: Error = Error::new("FINGERPRINT before MESSAGE-INTEGRITY attribute".to_owned());
38    // ErrBadUnknownAttrsSize means that UNKNOWN-ATTRIBUTES attribute value
39    // has invalid length.
40    pub static ref ERR_BAD_UNKNOWN_ATTRS_SIZE: Error = Error::new("bad UNKNOWN-ATTRIBUTES size".to_owned());
41    // ErrBadIPLength means that len(IP) is not net.{IPv6len,IPv4len}.
42    pub static ref ERR_BAD_IP_LENGTH: Error = Error::new("invalid length of IP value".to_owned());
43    // ErrNoConnection means that ClientOptions.Connection is nil.
44    pub static ref ERR_NO_CONNECTION: Error = Error::new("no connection provided".to_owned());
45    // ErrClientClosed indicates that client is closed.
46    pub static ref ERR_CLIENT_CLOSED: Error = Error::new("client is closed".to_owned());
47    // ErrNoAgent indicates that agent is not set.
48    pub static ref ERR_NO_AGENT: Error = Error::new("no agent is set".to_owned());
49    // ErrCollectorClosed indicates that client is closed.
50    pub static ref ERR_COLLECTOR_CLOSED: Error = Error::new("collector is closed".to_owned());
51    // ErrUnsupportedNetwork indicates that client is closed.
52    pub static ref ERR_UNSUPPORTED_NETWORK: Error = Error::new("unsupported network".to_owned());
53    pub static ref ERR_INVALID_URL: Error = Error::new("invalid url".to_owned());
54    // ErrSchemeType indicates the scheme type could not be parsed.
55    pub static ref ERR_SCHEME_TYPE:Error = Error::new("unknown scheme type".to_owned());
56    // ErrHost indicates malformed hostname is provided.
57    pub static ref ERR_HOST:Error = Error::new("invalid hostname".to_owned());
58}