Skip to main content

ohos_resource_manager_binding/
error.rs

1#[derive(Debug)]
2pub enum RawFileError {
3    IsNotRawDir(String),
4    FfiInnerError(String),
5}
6
7impl std::fmt::Display for RawFileError {
8    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9        match self {
10            RawFileError::IsNotRawDir(path) => write!(f, "Is not raw dir: {}", path),
11            RawFileError::FfiInnerError(msg) => write!(f, "Ffi inner error: {}", msg),
12        }
13    }
14}
15
16impl std::error::Error for RawFileError {}