Error refactor for peach-lib #38

Merged
glyph merged 8 commits from lib_error_refactor into main 2021-12-07 08:00:52 +00:00
Owner

This is a major refactor of the PeachError type, with associated changes to error-handling throughout the codebase of peach-lib. The snafu dependency has been removed in favour of a custom error implementation. The PeachError variants have also been refined to reduce unnecessary duplication by grouping related errors (total number of variants has been reduced from 27 to 19).

The refactored src/error.rs code is fully documented.

I imagine some fine-tuning may be required as we interact with this library via peach-web and other consumers.

Other Changes

  • Added module paths for imported functions (for example, config_manager::get_admin_password_hash())
  • Grouped related use statements by dependency
  • Removed unnecessary borrows to satisfy clippy
  • Remove all instances of unwrap() and expect()
  • Minor code changes to improve idiomaticity and/or ergonomics
This is a major refactor of the `PeachError` type, with associated changes to error-handling throughout the codebase of `peach-lib`. The `snafu` dependency has been removed in favour of a custom error implementation. The `PeachError` variants have also been refined to reduce unnecessary duplication by grouping related errors (total number of variants has been reduced from 27 to 19). The refactored `src/error.rs` code is fully documented. I imagine some fine-tuning may be required as we interact with this library via `peach-web` and other consumers. **Other Changes** - Added module paths for imported functions (for example, `config_manager::get_admin_password_hash()`) - Grouped related `use` statements by dependency - Removed unnecessary borrows to satisfy `clippy` - Remove all instances of `unwrap()` and `expect()` - Minor code changes to improve idiomaticity and/or ergonomics
glyph added 7 commits 2021-11-25 10:21:22 +00:00
glyph requested review from notplants 2021-11-25 10:21:56 +00:00
glyph added the
refactor
peach-lib
labels 2021-11-25 10:22:54 +00:00
glyph added 1 commit 2021-11-30 11:55:24 +00:00
Author
Owner

I'm going ahead with a merge on this.

I'm going ahead with a merge on this.
glyph merged commit a1444cf478 into main 2021-12-07 08:00:52 +00:00
Sign in to join this conversation.
No description provided.