openapi_nexus_parser/
error.rs1use snafu::Snafu;
4
5#[derive(Debug, Snafu)]
7#[snafu(visibility(pub))]
8pub enum ParseError {
9 #[snafu(display("Failed to read file '{}': {}", path, source))]
10 FileRead {
11 path: String,
12 source: std::io::Error,
13 },
14
15 #[snafu(display("Failed to parse JSON: {}", source))]
16 JsonParse {
17 source: serde_json::Error,
18 context: Vec<String>,
19 },
20
21 #[snafu(display("Failed to parse YAML: {}", source))]
22 YamlParse {
23 source: serde_norway::Error,
24 context: Vec<String>,
25 },
26
27 #[snafu(display("Unsupported file format: {}", format))]
28 UnsupportedFormat { format: String },
29
30 #[snafu(display("Failed to deserialize OpenAPI schema from JSON: {}", source))]
31 OpenApiDeserializeJson { source: serde_json::Error },
32
33 #[snafu(display("Failed to deserialize OpenAPI schema from YAML: {}", source))]
34 OpenApiDeserializeYaml { source: serde_norway::Error },
35}