Workspace of 9 crates (noxis, noxis-core, noxis-classfile, noxis-analysis, noxis-passes, noxis-runtime, noxis-jar, noxis-verify, noxis-structure-check). AGPL-3.0-only license, Rust 2024 edition, unsafe_code denied.
29 lines
821 B
Rust
29 lines
821 B
Rust
//! Ошибки ядра пайплайна.
|
|
|
|
use crate::config::PassId;
|
|
|
|
/// Ошибка уровня ядра.
|
|
#[derive(Debug, thiserror::Error)]
|
|
pub enum CoreError {
|
|
#[error("ошибка ввода-вывода: {0}")]
|
|
Io(#[from] std::io::Error),
|
|
|
|
#[error("некорректная конфигурация: {0}")]
|
|
Config(String),
|
|
|
|
#[error("ошибка классового файла: {0}")]
|
|
Classfile(#[from] noxis_classfile::ClassfileError),
|
|
|
|
#[error("пасс `{pass}` не смог выполниться: {msg}")]
|
|
Pass { pass: PassId, msg: String },
|
|
}
|
|
|
|
impl CoreError {
|
|
/// Ошибка конкретного пасса.
|
|
pub fn pass(pass: PassId, msg: impl Into<String>) -> Self {
|
|
Self::Pass {
|
|
pass,
|
|
msg: msg.into(),
|
|
}
|
|
}
|
|
}
|