#[non_exhaustive]pub enum Error {
Show 29 variants
NoRoom {},
RanOut {},
BadString,
BadName,
BadKex,
BadDecrypt,
BadSig,
BadNumber,
SSHProto {},
SSHProtoUnsupported,
BadKeyFormat,
NotSSH,
BadKey,
NoChannels,
BadChannel {
num: ChanNum,
},
BadChannelData,
BadUsage {},
WrongPacketLength,
ChannelEOF,
SessionEOF,
NotAvailable {
what: &'static str,
},
UnknownPacket {
number: u8,
},
PacketWrong {},
AlgoNoMatch {
algo: &'static str,
},
BigPacket {
size: usize,
},
NoAuthMethods,
UnknownMethod {
kind: &'static str,
},
Custom {
msg: &'static str,
},
Bug,
}Expand description
The Sunset error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
NoRoom
Output buffer ran out of room
RanOut
Input buffer ran out
BadString
Not a UTF-8 string
BadName
Not a valid SSH ASCII string
BadKex
Key exchange incorrect
BadDecrypt
Packet integrity failed
BadSig
Signature is incorrect
BadNumber
Integer overflow in packet
SSHProto
Error in received SSH protocol. Will disconnect.
SSHProtoUnsupported
Peer sent something we don’t handle. Will disconnect.
This differs to SSHProtoError. In this case the peer may be
behaved within the SSH specifications, but Sunset doesn’t
support it.
BadKeyFormat
Received a key with invalid structure, or too large.
NotSSH
Remote peer isn’t SSH 2.0
BadKey
Bad key format
NoChannels
Ran out of channels
BadChannel
BadChannelData
Bad channel data type
Returned from an API call that would imply ChanData::Stderr being sent to a server. This error will not be returned for network data in the incorrect direction, instead that data is dropped.
BadUsage
Bad application usage
Returned from an API call when the API is used incorrectly. Examples could include:
- A
ChanHandleis used incorrectly, for example being cloned (millions of times) and not released.
WrongPacketLength
SSH packet contents doesn’t match length
ChannelEOF
Channel EOF
This is an expected error when a SSH channel completes. Can be returned by channel read/write functions. Any further calls in the same direction will fail similarly.
SessionEOF
Session EOF
This is an expected error when the SSH session has finished.
NotAvailable
UnknownPacket
PacketWrong
Received packet at a disallowed time.
AlgoNoMatch
BigPacket
NoAuthMethods
Ran out of authentication methods to try (as a client)
UnknownMethod
An unknown SSH name is provided, for a key type, signature type, channel name etc.
Custom
Bug
Program bug
Implementations§
Source§impl Error
impl Error
pub fn msg(m: &'static str) -> Error
Sourcepub fn bug() -> Error
pub fn bug() -> Error
Panics in debug builds, returns Error::Bug in release.
Sourcepub fn bug_fmt(args: Arguments<'_>) -> Error
pub fn bug_fmt(args: Arguments<'_>) -> Error
Like bug() but with a message
The message can be used instead of a code comment, is logged at trace level.
Sourcepub fn bug_msg<T>(msg: &str) -> Result<T, Error>
pub fn bug_msg<T>(msg: &str) -> Result<T, Error>
TODO: is the generic T going to make it bloat?
pub fn bug_err_msg(msg: &str) -> Error
Trait Implementations§
Source§impl ErrorCompat for Error
impl ErrorCompat for Error
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read more