aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd/stream.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2019-10-19 10:27:51 -0400
committerJesse Luehrs <doy@tozt.net>2019-10-19 10:27:51 -0400
commitdef954fba185eae5773e9d81082d78e7ecc00f6a (patch)
tree4ca9a027b73f7aef4be98fda58dfa66b9c39af29 /src/cmd/stream.rs
parent58169bf0a3dd4b1f9ace3ad861f312a9ed956430 (diff)
downloadteleterm-def954fba185eae5773e9d81082d78e7ecc00f6a.tar.gz
teleterm-def954fba185eae5773e9d81082d78e7ecc00f6a.zip
improve error messages
Diffstat (limited to 'src/cmd/stream.rs')
-rw-r--r--src/cmd/stream.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/cmd/stream.rs b/src/cmd/stream.rs
index 95c1191..11634d3 100644
--- a/src/cmd/stream.rs
+++ b/src/cmd/stream.rs
@@ -95,13 +95,15 @@ impl crate::config::Config for Config {
let connector = connector.clone();
let connector = tokio_tls::TlsConnector::from(connector);
let stream = tokio::net::tcp::TcpStream::connect(&address);
- Box::new(stream.context(crate::error::Connect).and_then(
- move |stream| {
- connector
- .connect(&host, stream)
- .context(crate::error::ConnectTls)
- },
- ))
+ Box::new(
+ stream
+ .context(crate::error::Connect { address })
+ .and_then(move |stream| {
+ connector
+ .connect(&host, stream)
+ .context(crate::error::ConnectTls { host })
+ }),
+ )
});
Box::new(StreamSession::new(
&self.command,
@@ -114,7 +116,7 @@ impl crate::config::Config for Config {
let connect: crate::client::Connector<_> = Box::new(move || {
Box::new(
tokio::net::tcp::TcpStream::connect(&address)
- .context(crate::error::Connect),
+ .context(crate::error::Connect { address }),
)
});
Box::new(StreamSession::new(