1use thiserror::Error;
16
17#[derive(Error, Debug)]
18pub enum CustomError {
19 #[error("Error during generation of a proof")]
20 ProofGenerationError(String),
21
22 #[error("Error during verification of a proof")]
23 ProofVerificationError(String),
24
25 #[error("Error during creation of a JWK")]
26 JwkGenerationError(String),
27
28 #[error("Issued Jwp NOT valid")]
29 InvalidIssuedJwp,
30
31 #[error("Presented Jwp NOT valid")]
32 InvalidPresentedJwp,
33
34 #[error("Issued Proof verification failed!")]
35 InvalidIssuedProof,
36
37 #[error("Presented Proof verification failed!")]
38 InvalidPresentedProof,
39
40 #[error("Index out of bounds!")]
41 IndexOutOfBounds,
42
43 #[error("Incomplete Jwp build")]
44 IncompleteJwpBuild(IncompleteJwpBuild),
45
46 #[error("Error during JSON flattening process")]
47 FlatteningError,
48
49 #[error("Error during selective disclosure of an attribute")]
50 SelectiveDisclosureError,
51
52 #[error("Serialization failed")]
53 SerializationError,
54
55 #[error("Invalid JWK")]
56 InvalidJwk,
57
58 #[error("Curve is not supported")]
59 CurveNotSupported,
60}
61
62#[derive(Error, Debug)]
63pub enum IncompleteJwpBuild {
64 #[error("Issuer Header Not set!")]
65 NoIssuerHeader,
66
67 #[error("Presentation Header Not set!")]
68 NoPresentationHeader,
69
70 #[error("Claims and Payloads Not set!")]
71 NoClaimsAndPayloads,
72
73 #[error("JWK Not set! Cannot generate a JWP!")]
74 NoJwk,
75}