Compare commits

...

2 Commits

Author SHA1 Message Date
e8b9ec020d fix: Corrupted state should panic
Signed-off-by: quexeky <git@quexeky.dev>
2025-09-27 16:05:19 +10:00
cc417d6d69 fix: Send download signal instead of triggering self.on_error
Signed-off-by: quexeky <git@quexeky.dev>
2025-09-27 16:03:02 +10:00

View File

@ -453,23 +453,9 @@ impl GameDownloadAgent {
let sender = self.sender.clone();
let download_context = match download_contexts
let download_context = download_contexts
.get(&bucket.version)
.ok_or(RemoteAccessError::CorruptedState)
{
Ok(context) => context,
Err(e) => {
error!("Could not get download context with error {e}");
send!(
sender,
DownloadManagerSignal::Error(ApplicationDownloadError::DownloadError(
e
))
);
return;
}
};
.unwrap_or_else(|| panic!("Could not get bucket version {}. Corrupted state.", bucket.version));
scope.spawn(move |_| {
// 3 attempts
@ -707,7 +693,7 @@ impl Downloadable for GameDownloadAgent {
Ok(_) => {}
Err(e) => {
error!("could not mark game as complete: {e}");
self.on_error(app_handle, &ApplicationDownloadError::DownloadError(e));
send!(self.sender, DownloadManagerSignal::Error(ApplicationDownloadError::DownloadError(e)));
}
}
}