Skip to content

Commit 3b96e05

Browse files
authored
Merge pull request #130 from rorp/refactor_kormir
2 parents 0c0125a + cfc507c commit 3b96e05

File tree

2 files changed

+1334
-224
lines changed

2 files changed

+1334
-224
lines changed

kormir/src/error.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,18 @@ use std::fmt::{Display, Formatter};
44
#[derive(Debug, Clone)]
55
pub enum Error {
66
/// Invalid argument given
7+
#[deprecated(since = "1.0.9")]
78
InvalidArgument,
9+
/// Invalid event ID given
10+
InvalidEventId,
11+
/// Invalid outcomes given
12+
InvalidOutcomes,
13+
/// Invalid base given
14+
InvalidBase,
15+
/// Invalid number of digits given
16+
InvalidNumberOfDigits,
17+
/// Invalid nonces given
18+
InvalidNonces,
819
/// Attempted to sign an event that was already signed
920
EventAlreadySigned,
1021
/// Event data was not found
@@ -13,18 +24,30 @@ pub enum Error {
1324
StorageFailure,
1425
/// User gave an invalid outcome
1526
InvalidOutcome,
27+
/// User gave an invalid event descriptor
28+
InvalidEventDescriptor,
29+
/// User gave an invalid announcement
30+
InvalidAnnouncement,
1631
/// An error that should never happen, if it does it's a bug
1732
Internal,
1833
}
1934

2035
impl Display for Error {
2136
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
2237
match self {
38+
#[allow(deprecated)]
2339
Error::InvalidArgument => write!(f, "Invalid argument given"),
40+
Error::InvalidEventId => write!(f, "Invalid event ID given"),
41+
Error::InvalidOutcomes => write!(f, "Invalid outcomes given"),
42+
Error::InvalidBase => write!(f, "Invalid base given"),
43+
Error::InvalidNumberOfDigits => write!(f, "Invalid number of digits given"),
44+
Error::InvalidNonces => write!(f, "Invalid nonces given"),
2445
Error::EventAlreadySigned => write!(f, "Event already signed"),
2546
Error::NotFound => write!(f, "Event data not found"),
2647
Error::StorageFailure => write!(f, "Storage failure"),
2748
Error::InvalidOutcome => write!(f, "Invalid outcome"),
49+
Error::InvalidEventDescriptor => write!(f, "Invalid event descriptor"),
50+
Error::InvalidAnnouncement => write!(f, "Invalid announcement"),
2851
Error::Internal => write!(f, "Internal error"),
2952
}
3053
}

0 commit comments

Comments
 (0)