mirror of
https://github.com/YGGverse/ggemini.git
synced 2026-04-01 09:35:33 +00:00
update memory input stream errors handler
This commit is contained in:
parent
3a9e84a3d9
commit
239786da6a
6 changed files with 27 additions and 12 deletions
|
|
@ -1,5 +1,20 @@
|
|||
use std::fmt::{Display, Formatter, Result};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error {
|
||||
BytesTotal,
|
||||
InputStream,
|
||||
BytesTotal(usize, usize),
|
||||
InputStream(glib::Error),
|
||||
}
|
||||
|
||||
impl Display for Error {
|
||||
fn fmt(&self, f: &mut Formatter) -> Result {
|
||||
match self {
|
||||
Self::BytesTotal(total, limit) => {
|
||||
write!(f, "Bytes total limit reached: {total} / {limit}")
|
||||
}
|
||||
Self::InputStream(reason) => {
|
||||
write!(f, "Input stream error: {reason}")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue