Add some context to parse errors
This commit is contained in:
parent
7495682e41
commit
5e796365f1
|
@ -1,5 +1,5 @@
|
|||
"day","wday","lunch","dinner"
|
||||
"2022-01-01","sabato",,
|
||||
"2022-01-01","sabato",,"Ragù di carne"
|
||||
"2022-01-02","domenica",,
|
||||
"2022-01-03","lunedì",,
|
||||
"2022-01-04","martedì",,
|
||||
|
@ -33,7 +33,7 @@
|
|||
"2022-02-01","martedì",,
|
||||
"2022-02-02","mercoledì",,
|
||||
"2022-02-03","giovedì",,
|
||||
"2022-02-04","venerdì",,
|
||||
"2022-02-04","venerdì",,"Ragù di carne"
|
||||
"2022-02-05","sabato",,"https://ricette.giallozafferano.it/Chili-con-carne.html"
|
||||
"2022-02-06","domenica",,
|
||||
"2022-02-07","lunedì",,
|
||||
|
@ -97,7 +97,7 @@
|
|||
"2022-04-06","mercoledì",,
|
||||
"2022-04-07","giovedì",,
|
||||
"2022-04-08","venerdì",,"https://ricette.giallozafferano.it/Ratatouille.html"
|
||||
"2022-04-09","sabato",,
|
||||
"2022-04-09","sabato",,"Ragù di carne"
|
||||
"2022-04-10","domenica",,
|
||||
"2022-04-11","lunedì",,
|
||||
"2022-04-12","martedì",,
|
||||
|
@ -258,7 +258,7 @@
|
|||
"2022-09-14","mercoledì",,"https://ricette.giallozafferano.it/Scaloppine-ai-funghi.html"
|
||||
"2022-09-15","giovedì",,
|
||||
"2022-09-16","venerdì",,"https://ricette.giallozafferano.it/Cordon-bleu-di-melanzane.html"
|
||||
"2022-09-17","sabato",,
|
||||
"2022-09-17","sabato",,"Ragù di carne"
|
||||
"2022-09-18","domenica",,
|
||||
"2022-09-19","lunedì",,
|
||||
"2022-09-20","martedì",,
|
||||
|
@ -300,7 +300,7 @@
|
|||
"2022-10-26","mercoledì",,
|
||||
"2022-10-27","giovedì",,
|
||||
"2022-10-28","venerdì",,"https://ricette.giallozafferano.it/Vellutata-di-zucca-e-carote.html"
|
||||
"2022-10-29","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html",
|
||||
"2022-10-29","sabato","https://ricette.giallozafferano.it/Orata-al-forno.html","Ragù di carne"
|
||||
"2022-10-30","domenica",,
|
||||
"2022-10-31","lunedì",,
|
||||
"2022-11-01","martedì",,
|
||||
|
@ -342,7 +342,7 @@
|
|||
"2022-12-07","mercoledì",,"https://ricette.giallozafferano.it/Involtini-di-cotoletta.html"
|
||||
"2022-12-08","giovedì",,
|
||||
"2022-12-09","venerdì",,
|
||||
"2022-12-10","sabato","https://ricette.giallozafferano.it/Gnudi.html",
|
||||
"2022-12-10","sabato","https://ricette.giallozafferano.it/Gnudi.html","Ragù di carne"
|
||||
"2022-12-11","domenica",,
|
||||
"2022-12-12","lunedì",,
|
||||
"2022-12-13","martedì",,
|
||||
|
|
|
|
@ -7,7 +7,7 @@ use {
|
|||
crate::recipe,
|
||||
crate::scheduling::{Meal, Scheduling},
|
||||
crate::{constants, helpers},
|
||||
anyhow::{bail, Result},
|
||||
anyhow::{anyhow, bail, Result},
|
||||
chrono::naive::NaiveDate,
|
||||
futures::future::try_join_all,
|
||||
icalendar::Event,
|
||||
|
@ -93,17 +93,13 @@ async fn get_all_recipes(api_client: &ApiClient) -> Result<HashMap<String, Rc<re
|
|||
.await?;
|
||||
|
||||
let recipes = metadata.iter().map(|rm| async {
|
||||
let recipe_url = api_client
|
||||
.base_url()
|
||||
.join(&format!("apps/cookbook/api/recipes/{id}", id = rm.id))
|
||||
.unwrap();
|
||||
let response = api_client
|
||||
.rest(|client| async {
|
||||
let r = client
|
||||
.get(
|
||||
api_client
|
||||
.base_url()
|
||||
.join(&format!("apps/cookbook/api/recipes/{id}", id = rm.id))
|
||||
.unwrap(),
|
||||
)
|
||||
.send()
|
||||
.await;
|
||||
let r = client.get(recipe_url.clone()).send().await;
|
||||
Ok(r?)
|
||||
})
|
||||
.await?;
|
||||
|
@ -112,7 +108,7 @@ async fn get_all_recipes(api_client: &ApiClient) -> Result<HashMap<String, Rc<re
|
|||
.json::<recipe::Recipe>()
|
||||
.await
|
||||
.map(|r| Rc::new(r))
|
||||
.map_err(|err| anyhow::anyhow!(err))
|
||||
.map_err(|err| anyhow!(err).context(format!("while fetching {}", recipe_url)))
|
||||
});
|
||||
|
||||
let recipes = try_join_all(recipes).await?;
|
||||
|
|
Loading…
Reference in New Issue