afvalcalendar: Add proper error handling

master
Tristan Daniël Maat 2024-04-30 06:09:04 +02:00
parent d8f1b9941e
commit 0312fbad3a
Signed by: tlater
GPG Key ID: 49670FD774E43268
2 changed files with 18 additions and 5 deletions

View File

@ -140,9 +140,17 @@
sops-nix.packages.${system}.sops-import-keys-hook
];
packages = [
packages = with pkgs; [
sops-nix.packages.${system}.sops-init-gpg-key
deploy-rs.packages.${system}.default
cargo
clippy
rustc
rustfmt
rust-analyzer
pkg-config
openssl
];
};
};

View File

@ -3,8 +3,13 @@ mod trash;
#[tokio::main]
async fn main() {
let dates = trash::get_pickup_dates().await.unwrap();
let calendar = calendar::calendar_from_pickup_dates(dates);
calendar.print().unwrap();
match trash::get_pickup_dates().await {
Ok(dates) => {
let calendar = calendar::calendar_from_pickup_dates(dates);
calendar.print().unwrap();
}
Err(error) => {
eprintln!("{}", error);
}
}
}