Log fetch errors

This commit is contained in:
Maximilian Ammann 2022-04-13 16:46:02 +02:00
parent a19f0ddfc1
commit 3bba2e42fa

View File

@ -229,12 +229,14 @@ impl<W> MapState<W> {
.schedule(
self.shared_thread_state.clone(),
move |state: SharedThreadState| async move {
if let Ok(data) = client.fetch(&coords).await {
state
match client.fetch(&coords).await {
Ok(data) => state
.process_tile(request_id, data.into_boxed_slice())
.unwrap();
} else {
state.tile_unavailable(request_id).unwrap();
.unwrap(),
Err(e) => {
log::error!("{:?}", &e);
state.tile_unavailable(request_id).unwrap()
}
}
},
)