#[non_exhaustive]pub enum Error {
Show 27 variants
BytesErr {
object: &'static str,
err: Error,
},
ChanIoErr(Arc<Error>),
HandshakeIoErr(Arc<Error>),
CellEncodeErr {
object: &'static str,
err: Error,
},
CellDecodeErr {
object: &'static str,
err: Error,
},
EncodeErr {
object: &'static str,
err: EncodeError,
},
HandshakeCertErr(CertError),
InvalidKDFOutputLength,
NoSuchHop,
BadCellAuth,
BadCircHandshakeAuth,
HandshakeProto(String),
HandshakeCertsExpired {
expired_by: Duration,
},
ChanProto(String),
CircProto(String),
ChannelClosed(ChannelClosed),
CircuitClosed,
IdRangeFull,
CircRefused(&'static str),
BadStreamAddress,
EndReceived(EndReason),
NotConnected,
StreamProto(String),
ChanMismatch(String),
Bug(Bug),
ResolveError(ResolveError),
MissingId(RelayIdType),
}Expand description
An error type for the tor-proto crate.
This type should probably be split into several. There’s more than one kind of error that can occur while doing something with the Tor protocol.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BytesErr
Fields
An error that occurred in the tor_bytes crate while decoding an object.
ChanIoErr(Arc<Error>)
An error that occurred from the io system when using a channel.
HandshakeIoErr(Arc<Error>)
An error from the io system that occurred when trying to connect a channel.
CellEncodeErr
Fields
An error occurred while trying to create or encode a cell.
CellDecodeErr
An error occurred while trying to decode or parse a cell.
EncodeErr
Fields
err: EncodeErrorThe error that occurred.
An error occurred while trying to create or encode some non-cell message.
This is likely the result of a bug: either in this crate, or the code that provided the input.
HandshakeCertErr(CertError)
We found a problem with one of the certificates in the channel handshake.
InvalidKDFOutputLength
We tried to produce too much output for a key derivation function.
NoSuchHop
We tried to encrypt a message to a hop that wasn’t there.
BadCellAuth
The authentication information on this cell was completely wrong, or the cell was corrupted.
BadCircHandshakeAuth
A circuit-extension handshake failed due to a mismatched authentication value.
HandshakeProto(String)
Handshake protocol violation.
HandshakeCertsExpired
Handshake broken, maybe due to clock skew.
(If the problem can’t be due to clock skew, we return HandshakeProto instead.)
ChanProto(String)
Protocol violation at the channel level, other than at the handshake stage.
CircProto(String)
Protocol violation at the circuit level
ChannelClosed(ChannelClosed)
Channel is closed, or became closed while we were trying to do some operation.
CircuitClosed
Circuit is closed, or became closed while we were trying to so some operation.
IdRangeFull
Can’t allocate any more circuit or stream IDs on a channel.
CircRefused(&'static str)
Couldn’t extend a circuit because the extending relay or the target relay refused our request.
BadStreamAddress
Tried to make or use a stream to an invalid destination address.
EndReceived(EndReason)
Received an End cell from the other end of a stream.
NotConnected
Stream was already closed when we tried to use it.
StreamProto(String)
Stream protocol violation
ChanMismatch(String)
Channel does not match target
Bug(Bug)
There was a programming error somewhere in our code, or the calling code.
ResolveError(ResolveError)
Remote DNS lookup failed.
MissingId(RelayIdType)
We tried to do something with a that we couldn’t, because of an identity key type that the relay doesn’t have.