shex_ast/ast/
schema_json_error.rs

1use std::path::PathBuf;
2
3use iri_s::{IriS, IriSError};
4use thiserror::Error;
5
6#[derive(Error, Debug, Clone)]
7pub enum SchemaJsonError {
8    #[error("Reading path {path_name:?} error: {error:?}")]
9    ReadingPathError {
10        path_name: String,
11        error: String, // We need to clone so we use String instead of io::Error
12    },
13
14    #[error("Reading JSON from {path_name:?}. Error: {error:?}")]
15    JsonError {
16        path_name: String,
17        error: String, // We need to clone errors so we use String instead of serde_json::Error,
18    },
19
20    #[error("Reading JSON from reader. Error: {error:?}")]
21    JsonErrorFromReader {
22        error: String, // We need to clone errors so we use String instead of serde_json::Error,
23    },
24
25    #[error("Shape Decl with prefixed shape {prefix:}:{local} but no prefix map declaration")]
26    ShapeDeclPrefixNoPrefixMap { prefix: String, local: String },
27
28    #[error(transparent)]
29    PrefixMapError {
30        #[from]
31        err: prefixmap::PrefixMapError,
32    },
33
34    #[error("Obtaining current dir: {error:?}")]
35    CurrentDir { error: String },
36
37    #[error("Obtaining Url from local dir: {path}")]
38    LocalFolderIriError { path: PathBuf },
39
40    #[error("Trying to dereference IRI: {iri}: {error}")]
41    DereferencingIri { iri: IriS, error: IriSError },
42
43    #[error("Obtaining schema from IRI {iri}. Error: {error}")]
44    SchemaFromIri { iri: IriS, error: String },
45}