-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Improve Error Handling by Adding Display Implementations (#140)
This pull request aims to improve the error-handling mechanism of the codebase by providing more descriptive error messages. It involves changes across multiple files (`cell.rs`, `log.rs`) to add implementations for the `fmt::Display` trait for `InitError`. #### Key Changes: 1. **Consistent Formatting**: Replaced `std::fmt` with `fmt` to maintain consistency in the code. - File: `btreemap.rs` 2. **Enhanced Error Messages for `InitError` in `cell.rs`**: - Describes errors related to incompatible versions and value sizes. 3. **Detailed Error Messages for `InitError` in `log.rs`**: - Explains issues with incompatible data and index versions, as well as invalid indices. #### Why this is important: Better error messages enhance the debugging experience and allow developers to understand the issues quickly, thereby saving time and effort. #### Files Changed: - `src/btreemap.rs` - `src/cell.rs` - `src/log.rs` #### Types of changes: - [x] Bugfix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Documentation Update (if none of the other choices apply) Co-authored-by: Islam El-Ashi <islam.elashi@dfinity.org>
- Loading branch information
Showing
3 changed files
with
49 additions
and
3 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
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