imagePage: Show specific error for out of memory
Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/435>
This commit is contained in:
parent
9bd68cd8dd
commit
b33943fbe2
3 changed files with 16 additions and 5 deletions
|
|
@ -73,6 +73,8 @@ pub enum DecoderError {
|
|||
UnsupportedFormat,
|
||||
/// No glycin-loaders installed
|
||||
NoLoadersConfigured,
|
||||
/// Memory limit exceeded
|
||||
OutOfMemory,
|
||||
#[default]
|
||||
None,
|
||||
}
|
||||
|
|
@ -118,6 +120,9 @@ impl UpdateSender {
|
|||
update_sender.send(DecoderUpdate::SpecificError(
|
||||
DecoderError::UnsupportedFormat,
|
||||
));
|
||||
}
|
||||
if err.is_out_of_memory() {
|
||||
update_sender.send(DecoderUpdate::SpecificError(DecoderError::OutOfMemory));
|
||||
} else if matches!(err.error(), glycin::Error::NoLoadersConfigured(_)) {
|
||||
update_sender.send(DecoderUpdate::SpecificError(
|
||||
DecoderError::NoLoadersConfigured,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue