-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Error handling for Serialization
This commit adds error handling for the crate using thiserror crate. Also, based on the error handling, making serialization of `AAD` eleganttly be handled with result mechanism. Signed-off-by: Xynnn007 <[email protected]>
- Loading branch information
Showing
3 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use thiserror::Error; | ||
|
||
pub type Result<T> = core::result::Result<T, KbsTypesError>; | ||
|
||
#[derive(Error, Debug)] | ||
pub enum KbsTypesError { | ||
#[error("Serialize/Deserialize error")] | ||
Serde, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters