-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean up errors, print Display instead of Debug format of error
- Loading branch information
Showing
3 changed files
with
10 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,13 @@ | ||
use base64::DecodeError; | ||
|
||
#[derive(thiserror::Error, Debug)] | ||
pub enum Error { | ||
#[error("io operation error.")] | ||
IoError(#[from] std::io::Error), | ||
|
||
#[error("Json serialization error.")] | ||
JsonError(#[from] serde_json::Error), | ||
|
||
#[error("Failed to decode base64 content of OpenSSH key.")] | ||
DecodeError(#[from] DecodeError), | ||
#[error("{0}")] | ||
IO(#[from] std::io::Error), | ||
|
||
#[error("SSH forwarding network tunnel exit with non-zero exit code {0}")] | ||
TunnelExitNonZero(String), | ||
|
||
#[error("network tunnel requested, but no destination address was found in the endpoint configuration")] | ||
MissingDestinationAddress, | ||
|
||
#[error("malformed destination address {0}")] | ||
BadDestinationAddress(String), | ||
|
||
// Used to silently terminate the SSH tunnel without logging any further errors | ||
// Used to bubble up SSH tunnel errors without logging any further errors | ||
// this allows the last `ssh: ` log to be reported as the main error to the user | ||
#[error("")] | ||
SilentError | ||
#[error("{0}")] | ||
SSH(String) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters