aboutsummaryrefslogtreecommitdiff
path: root/libnres/src/error.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2025-02-08 04:11:02 +0300
committerValentin Popov <valentin@popov.link>2025-02-08 04:11:02 +0300
commit8d8653133bf3a12ac58c0e4f34624e9beac11751 (patch)
treeac0831704db9f138a90872b530eabda457db1829 /libnres/src/error.rs
parent94d2f8a512312b8aff25672760b687e6d90c1ec9 (diff)
downloadfparkan-8d8653133bf3a12ac58c0e4f34624e9beac11751.tar.xz
fparkan-8d8653133bf3a12ac58c0e4f34624e9beac11751.zip
Обновление структуры проекта
Diffstat (limited to 'libnres/src/error.rs')
-rw-r--r--libnres/src/error.rs45
1 files changed, 0 insertions, 45 deletions
diff --git a/libnres/src/error.rs b/libnres/src/error.rs
deleted file mode 100644
index 440ab06..0000000
--- a/libnres/src/error.rs
+++ /dev/null
@@ -1,45 +0,0 @@
-extern crate miette;
-extern crate thiserror;
-
-use miette::Diagnostic;
-use thiserror::Error;
-
-#[derive(Error, Diagnostic, Debug)]
-pub enum ConverterError {
- #[error("error converting an value")]
- #[diagnostic(code(libnres::infallible))]
- Infallible(#[from] std::convert::Infallible),
-
- #[error("error converting an value")]
- #[diagnostic(code(libnres::try_from_int_error))]
- TryFromIntError(#[from] std::num::TryFromIntError),
-}
-
-#[derive(Error, Diagnostic, Debug)]
-pub enum ReaderError {
- #[error(transparent)]
- #[diagnostic(code(libnres::convert_error))]
- ConvertValue(#[from] ConverterError),
-
- #[error("incorrect header format")]
- #[diagnostic(code(libnres::list_type_error))]
- IncorrectHeader,
-
- #[error("incorrect file size (expected {expected:?} bytes, received {received:?} bytes)")]
- #[diagnostic(code(libnres::file_size_error))]
- IncorrectSizeFile { expected: u32, received: u32 },
-
- #[error(
- "incorrect size of the file list (not a multiple of {expected:?}, received {received:?})"
- )]
- #[diagnostic(code(libnres::list_size_error))]
- IncorrectSizeList { expected: u32, received: u32 },
-
- #[error("resource file reading error")]
- #[diagnostic(code(libnres::io_error))]
- ReadFile(#[from] std::io::Error),
-
- #[error("file is too small (must be at least {expected:?} bytes, received {received:?} byte)")]
- #[diagnostic(code(libnres::file_size_error))]
- SmallFile { expected: u32, received: u32 },
-}