use thiserror::Error;
#[derive(Error, Debug)]
pub enum ShExError {
#[error("Failed to initialize query store: {error}")]
FailedInitializingQueryStore { error: String },
#[error(
"Unsupported ShEx format: '{format}'. Valid formats are: 'internal', 'simple', 'shexc', 'shexj', 'json', 'jsonld', 'turtle', 'ntriples', 'rdfxml', 'trig', 'n3', 'nquads'"
)]
UnsupportedShExFormat { format: String },
#[error("Schema source specification error: {message}")]
DataSourceSpec { message: String },
#[error("Failed to parse ShEx schema from '{source_name}' in format '{format}': {error}")]
FailedParsingShExSchema {
error: String,
source_name: String,
format: String,
},
#[error("Failed to compile ShEx schema: {error}")]
FailedCompilingShExSchema { error: String },
#[error("No ShEx schema loaded")]
NoShExSchemaLoaded,
#[error("No shapemap loaded")]
NoShapemapLoaded,
#[error("No ShEx validation results available")]
NoShexValidationResultsAvailable,
#[error("Failed I/O operation: {error}")]
FailedIoOperation { error: String },
#[error("Failed to parse node selector '{node_selector}': {error}")]
NodeSelectorParseError { node_selector: String, error: String },
#[error("Failed to parse shape selector '{shape_selector}': {error}")]
ShapeSelectorParseError { shape_selector: String, error: String },
#[error("Invalid shape label '{label}': {error}")]
InvalidShapeLabel { label: String, error: String },
#[error("Failed to serialize ShEx schema to {format}: {error}")]
FailedSerializingShExSchema { format: String, error: String },
#[error("Failed to parse ShapeMap from '{source_name}': {error}")]
FailedParsingShapeMap { source_name: String, error: String },
#[error("Failed to serialize ShapeMap to {format}: {error}")]
FailedSerializingShapemap { format: String, error: String },
#[error("ShEx validation failed: {error}")]
FailedShExValidation { error: String },
#[error("Failed to serialize ShEx validation results to {format}: {error}")]
FailedSerializingShExValidationResults { format: String, error: String },
}