1use crate::iri::IriS;
2use serde::Serialize;
3use thiserror::Error;
4
5#[derive(Error, Debug, Clone, Serialize)]
7pub enum IriSError {
8 #[error("Error converting path {path} to IRI: {error}")]
10 ConvertingPathToIri { path: String, error: String },
11
12 #[error("Error parsing {str} as IRI: {error}")]
14 IriParseError { str: String, error: String },
15
16 #[error("Parsing {str} using base: {base} as IRI. Error: {error}")]
18 IriParseErrorWithBase { str: String, base: String, error: String },
19
20 #[error("Error resolving IRI `{other}` with base IRI `{base}`: {error}")]
22 IriResolveError {
23 error: String,
24 base: Box<IriS>,
25 other: String,
26 },
27
28 #[error("Error joining IRI `{current}` with `{str}`: {error}")]
30 JoinError {
31 error: String,
32 current: Box<IriS>,
33 str: String,
34 },
35
36 #[error("Creating reqwest http client: {error}")]
38 ReqwestClientCreation { error: String },
39
40 #[error("Parsing Iri {str} as Url. Error: {error}")]
42 UrlParseError { str: String, error: String },
43
44 #[error("Http request error: {error}")]
46 ReqwestError { error: String },
47
48 #[error("Http request error as String: {error}")]
50 ReqwestTextError { error: String },
51
52 #[error("trying to obtain a path from file scheme Url: {url}")]
54 ConvertingFileUrlToPath { url: String },
55
56 #[error("Error reading from file {path} obtained from url {url}. Error: {error}")]
58 IOErrorFile { path: String, url: String, error: String },
59
60 #[error("Error parsing Turtle string `{str}` as IRI: {error}")]
61 TurtleParseError { str: String, error: String },
62}