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