#[non_exhaustive]pub enum Error {
Master(Error),
Connect(Error),
SshMux(Error),
InvalidCommand,
Remote(Error),
Disconnected,
RemoteProcessTerminated,
Cleanup(Error),
ChildIo(Error),
}
Expand description
Errors that occur when interacting with a remote process.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Master(Error)
The master connection failed.
Connect(Error)
Failed to establish initial connection to the remote host.
SshMux(Error)
Failed to connect to the ssh multiplex server.
InvalidCommand
Invalid command that contains null byte.
Remote(Error)
The remote process failed.
Disconnected
The connection to the remote host was severed.
Note that for the process impl, this is a best-effort error, and it may instead signify that the remote process exited with an error code of 255.
You should call Session::check
to verify if you get
this error back.
RemoteProcessTerminated
Remote process is terminated.
It is likely to be that the process is terminated by signal.
NOTE that due to a fundamental design flaw in ssh multiplex protocol,
there is no way to tell RemoteProcessTerminated
from Disconnect
.
If you really need to identify Disconnect
, you can call session.check()
after wait()
returns RemoteProcessTerminated
, however the ssh multiplex master
could exit right after wait()
, meaning the remote process actually is terminated
instead of Disconnect
ed.
It is thus recommended to create your own workaround for your particular use cases.
Cleanup(Error)
Failed to remove temporary dir where ssh socket and output is stored.
ChildIo(Error)
IO Error when creating/reading/writing from ChildStdin, ChildStdout, ChildStderr.