|
1 | 1 | //! Errors returned by this type |
2 | 2 |
|
| 3 | +use displaydoc::Display; |
3 | 4 | use thiserror::Error; |
4 | 5 |
|
5 | 6 | use super::{key_rotation::KeyRotationError, role_index::RoleIndexError}; |
6 | 7 |
|
7 | 8 | /// Errors that can occur when parsing a `KidUri` |
8 | | -#[derive(Error, Debug)] |
| 9 | +#[derive(Display, Error, Debug)] |
9 | 10 | pub enum KidUriError { |
10 | 11 | /// Invalid KID URI |
11 | | - #[error("Invalid URI")] |
12 | 12 | InvalidURI(#[from] fluent_uri::error::ParseError), |
13 | 13 | /// Invalid Scheme, not a KID URI |
14 | | - #[error("Invalid Scheme, not a KID URI")] |
15 | 14 | InvalidScheme, |
16 | 15 | /// Network not defined in URI |
17 | | - #[error("No defined Network")] |
18 | 16 | NoDefinedNetwork, |
19 | 17 | /// Path of URI is invalid |
20 | | - #[error("Invalid Path")] |
21 | 18 | InvalidPath, |
22 | 19 | /// Role 0 Key in path is invalid |
23 | | - #[error("Invalid Role 0 Key")] |
24 | 20 | InvalidRole0Key, |
25 | 21 | /// Role 0 Key in path is not encoded correctly |
26 | | - #[error("Invalid Role 0 Key Encoding")] |
27 | 22 | InvalidRole0KeyEncoding(#[from] base64_url::base64::DecodeError), |
28 | 23 | /// Role Index is invalid |
29 | | - #[error("Invalid Role")] |
30 | 24 | InvalidRole, |
31 | 25 | /// Role Index is not encoded correctly |
32 | | - #[error("Invalid Role Index")] |
33 | 26 | InvalidRoleIndex(#[from] RoleIndexError), |
34 | 27 | /// Role Key Rotation is invalid |
35 | | - #[error("Invalid Rotation")] |
36 | 28 | InvalidRotation, |
37 | 29 | /// Role Key Rotation is not encoded correctly |
38 | | - #[error("Invalid Rotation Value")] |
39 | 30 | InvalidRotationValue(#[from] KeyRotationError), |
40 | 31 | /// Encryption key Identifier Fragment is not valid |
41 | | - #[error("Invalid Encryption Key Fragment")] |
42 | 32 | InvalidEncryptionKeyFragment, |
43 | 33 | } |
0 commit comments