Skip to content

Commit

Permalink
change error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k committed Aug 8, 2021
1 parent bd9cf99 commit fb1deb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async fn main() -> Result<()> {
let args = match parse_args() {
Ok(v) => v,
Err(e) => {
eprintln!("Argument error: {:?}", e);
eprintln!("Argument error: {}", e);
process::exit(1);
}
};
Expand All @@ -55,14 +55,14 @@ async fn main() -> Result<()> {
let file = match fs::read(args.config).await {
Ok(f) => f,
Err(e) => {
eprintln!("Error while reading config: {:?}", e);
eprintln!("Error while reading config: {}", e);
process::exit(1);
}
};
let config = match toml::from_slice::<Config>(&file[..]) {
Ok(c) => c,
Err(e) => {
eprintln!("Error while parsing config: {:?}", e);
eprintln!("Error while parsing config: {}", e);
process::exit(1);
}
};
Expand Down Expand Up @@ -158,7 +158,7 @@ fn watch_feeds(feeds: HashMap<String, Feed>, client: Client) -> Result<Vec<Task<
info!("Start watcher for \"{}\"", name);

if let Err(e) = watcher.watch(rx).await {
error!("Watcher for \"{}\" has an error: {:?}", name, &e);
error!("Watcher for \"{}\" has an error: {}", name, &e);
return Err(e);
}

Expand Down
4 changes: 2 additions & 2 deletions src/watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl<'a, T: Sink> Watcher<T> {
Ok(c) => c,
Err(e) => {
if is_timeout(&e) {
error!("Timeout while getting items: {:?}", e);
error!("Timeout while getting items: {}", e);
continue;
} else {
return Err(e);
Expand Down Expand Up @@ -81,7 +81,7 @@ impl<'a, T: Sink> Watcher<T> {

if let Err(err) = self.sink.push(news).await {
if is_timeout(&err) {
error!("Timeout while pushing items: {:?}", err);
error!("Timeout while pushing items: {}", err);
continue;
} else {
return Err(err);
Expand Down

0 comments on commit fb1deb3

Please sign in to comment.