Skip to content

Commit

Permalink
change "Timeout(Timeout)" to "No response from stdin"
Browse files Browse the repository at this point in the history
Should be much more helpful. Also no need to discern the RecvTimeout, it
will always be `Timeout`.
  • Loading branch information
benjajaja committed Jan 7, 2025
1 parent 8feb99a commit 39d62f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
use std::sync::mpsc::RecvTimeoutError;

#[derive(Debug, thiserror::Error)]
pub enum Errors {
#[error("Could not detect font size")]
NoFontSize,
#[error("Could not detect any graphics nor font capabilities")]
NoCap,
#[error("Timeout: {0}")]
Timeout(#[from] RecvTimeoutError),
#[error("No response from stdin")]
NoStdinResponse,
#[error("Sixel error: {0}")]
Sixel(String),
#[error("Tmux error: {0}")]
Expand Down
2 changes: 1 addition & 1 deletion src/picker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ fn query_with_timeout(

match rx.recv_timeout(timeout) {
Ok(result) => Ok(result?),
Err(err) => Err(err.into()),
Err(_recvtimeout) => Err(Errors::NoStdinResponse),
}
}

Expand Down

0 comments on commit 39d62f5

Please sign in to comment.