Skip to main content

harper_core/weirpack/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum Error {
5    #[error("IO error: {0}")]
6    Io(#[from] std::io::Error),
7    #[error("Zip error: {0}")]
8    Zip(#[from] zip::result::ZipError),
9    #[error("JSON error: {0}")]
10    Json(#[from] serde_json::Error),
11    #[error("Weir error: {0}")]
12    Weir(#[from] crate::weir::Error),
13    #[error("Missing manifest file '{0}'.")]
14    MissingManifest(&'static str),
15    #[error("Manifest field '{0}' is missing.")]
16    MissingManifestField(&'static str),
17    #[error("Manifest field '{0}' must be a string.")]
18    InvalidManifestFieldType(&'static str),
19    #[error("Duplicate manifest file '{0}'.")]
20    DuplicateManifest(&'static str),
21    #[error("Invalid rule filename '{0}'.")]
22    InvalidRuleFileName(String),
23    #[error("The Rune dictionary is not valid.")]
24    InvalidDictionaryFormat,
25}