1 | // SPDX-FileCopyrightText: 2021 HH Partners |
2 | // |
3 | // SPDX-License-Identifier: MIT |
4 | |
5 | use std::io; |
6 | use thiserror::Error; |
7 | |
8 | #[derive (Debug, Error)] |
9 | pub enum SpdxError { |
10 | #[error("Error parsing the SPDX Expression." )] |
11 | Parse { |
12 | #[from] |
13 | source: spdx_expression::SpdxExpressionError, |
14 | }, |
15 | |
16 | #[error("Path {0} doesn't have an extension." )] |
17 | PathExtension(String), |
18 | |
19 | #[error("Error with file I/O." )] |
20 | Io { |
21 | #[from] |
22 | source: io::Error, |
23 | }, |
24 | |
25 | #[error("Error while parsing date." )] |
26 | DateTimeParse { |
27 | #[from] |
28 | source: chrono::ParseError, |
29 | }, |
30 | |
31 | #[error("Error parsing tag-value: {0}" )] |
32 | TagValueParse(String), |
33 | } |
34 | |