image/loading: Display first error, ignore second
Usually the first error is the relevant one. So show this one. Why we get more than one error at all is a bit unclear.
This commit is contained in:
parent
8b4beadcd9
commit
296817abe4
2 changed files with 7 additions and 0 deletions
|
|
@ -220,6 +220,12 @@ impl imp::LpImage {
|
|||
|
||||
fn set_error(&self, err: Option<anyhow::Error>) {
|
||||
log::debug!("Decoding error: {err:?}");
|
||||
|
||||
// Keeping first error instead of replacing with new error
|
||||
if err.is_some() && self.error.borrow().is_some() {
|
||||
return;
|
||||
}
|
||||
|
||||
self.error.replace(err.as_ref().map(|x| x.to_string()));
|
||||
self.obj().notify_error();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue