Skip to content

Commit

Permalink
Merge pull request #143 from ljrk0/verbose_tls_error
Browse files Browse the repository at this point in the history
Print more information for TLS errors
  • Loading branch information
tarkah authored Jul 12, 2023
2 parents feb9d43 + f24f1f7 commit caa024d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions data/src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,18 @@ pub async fn run(server: server::Entry, mut sender: mpsc::Sender<Update>) -> Nev
};
}
Err(e) => {
log::warn!("[{server}] connection failed: {e}");
let error = match e {
// unwrap Tls-specific error enums to access more error info
irc::error::Error::Tls(e) => format!("a TLS error occured: {e}"),
_ => e.to_string(),
};

log::warn!("[{server}] connection failed: {error}");

let _ = sender
.send(Update::ConnectionFailed {
server: server.clone(),
error: e.to_string(),
error,
})
.await;

Expand Down

0 comments on commit caa024d

Please sign in to comment.