imessage_database/error/
attachment.rs1use std::{
6 fmt::{Display, Formatter, Result},
7 io::Error,
8};
9
10#[derive(Debug)]
12pub enum AttachmentError {
13 FileNotFound(String),
14 Unreadable(String, Error),
15}
16
17impl Display for AttachmentError {
18 fn fmt(&self, fmt: &mut Formatter<'_>) -> Result {
19 match self {
20 AttachmentError::FileNotFound(path) => {
21 write!(fmt, "File not found at location: {path}")
22 }
23 AttachmentError::Unreadable(path, why) => {
24 write!(fmt, "Unable to read file at {path}: {why}")
25 }
26 }
27 }
28}