Skip to content

Commit 0fe84be

Browse files
feat: implement core::error::Error for all error types (#341)
1 parent 616892e commit 0fe84be

File tree

8 files changed

+19
-2
lines changed

8 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 0.10.2 (TBD)
4+
- Implement `core::error::Error` for error types (#341).
5+
36
## 0.10.1 (2024-10-30)
47
- Fixed partition hashing and add logging to aux trace building (#338).
58

air/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ impl fmt::Display for AssertionError {
4242
}
4343
}
4444
}
45+
46+
impl core::error::Error for AssertionError {}

crypto/src/errors.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ impl fmt::Display for MerkleTreeError {
6161
}
6262
}
6363

64+
impl core::error::Error for MerkleTreeError {}
65+
6466
// RANDOM COIN ERROR
6567
// ================================================================================================
6668

@@ -89,3 +91,5 @@ impl fmt::Display for RandomCoinError {
8991
}
9092
}
9193
}
94+
95+
impl core::error::Error for RandomCoinError {}

fri/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,5 @@ impl fmt::Display for VerifierError {
7373
}
7474
}
7575
}
76+
77+
impl core::error::Error for VerifierError {}

prover/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,5 @@ impl fmt::Display for ProverError {
3939
}
4040
}
4141
}
42+
43+
impl core::error::Error for ProverError {}

utils/core/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,5 @@ impl fmt::Display for DeserializationError {
3232
}
3333
}
3434
}
35+
36+
impl core::error::Error for DeserializationError {}

utils/core/src/serde/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl Serializable for str {
344344
}
345345

346346
fn get_size_hint(&self) -> usize {
347-
self.len().get_size_hint() + self.as_bytes().len()
347+
self.len().get_size_hint() + self.len()
348348
}
349349
}
350350

@@ -355,7 +355,7 @@ impl Serializable for String {
355355
}
356356

357357
fn get_size_hint(&self) -> usize {
358-
self.len().get_size_hint() + self.as_bytes().len()
358+
self.len().get_size_hint() + self.len()
359359
}
360360
}
361361

verifier/src/errors.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,5 @@ impl fmt::Display for VerifierError {
9999
}
100100
}
101101
}
102+
103+
impl core::error::Error for VerifierError {}

0 commit comments

Comments
 (0)