Skip to main content

ontologos_parser/
error.rs

1use thiserror::Error;
2
3/// Result type alias for parser operations.
4pub type Result<T> = std::result::Result<T, Error>;
5
6/// Errors returned by the OWL/RDF parser.
7#[derive(Debug, Error)]
8pub enum Error {
9    /// File extension or content is not a supported OWL/RDF format.
10    #[error("unsupported format: {0}")]
11    UnsupportedFormat(String),
12    /// Parse or I/O failure (missing file, size limit, horned-owl error).
13    #[error("parse error: {0}")]
14    Parse(String),
15    /// I/O failure while reading ontology files.
16    #[error(transparent)]
17    Io(#[from] std::io::Error),
18    /// Wrapped error from `ontologos-core` during axiom mapping.
19    #[error(transparent)]
20    Core(#[from] ontologos_core::Error),
21}