iri_s/
iris_error.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// use oxiri::Iri;
// use oxrdf::IriParseError;
use thiserror::Error;

use crate::IriS;

#[derive(Error, Debug, Clone)]
pub enum IriSError {
    #[error("Error parsing {str} as IRI: {err}")]
    IriParseError { str: String, err: String },

    #[error("Parsing {str} using base: {base} as IRI. Error: {error}")]
    IriParseErrorWithBase {
        str: String,
        base: String,
        error: String,
    },

    #[error("Error resolving IRI `{other}` with base IRI `{base}`: {err}")]
    IriResolveError {
        err: Box<String>,
        base: Box<IriS>,
        other: Box<IriS>,
    },

    #[error("Error joining IRI `{current}` with `{str}`: {err}")]
    JoinError {
        err: Box<String>,
        current: Box<IriS>,
        str: Box<String>,
    },
    #[error("Creating reqwest http client: {error}")]
    ReqwestClientCreation { error: String },

    #[error("Parsing Iri {str} as Url. Error: {error}")]
    UrlParseError { str: String, error: String },

    #[error("Http request error: {error}")]
    ReqwestError { error: String },

    #[error("Http request error as String: {error}")]
    ReqwestTextError { error: String },

    #[error("trying to obtain a path from file scheme Url: {url}")]
    ConvertingFileUrlToPath { url: String },

    #[error("Error reading from file {path} obtained from url {url}. Error: {error}")]
    IOErrorFile {
        path: String,
        url: String,
        error: String,
    },
}