feat: add is_* error predicates for all DbError categories (#91)#103
Conversation
|
@lxsaah I'm currently waiting for your approval. |
lxsaah
left a comment
There was a problem hiding this comment.
Thanks for jumping on this @ggmaldo, the code itself is in good shape: all 7 predicates added with the right matches! pattern, std-only ones correctly gated behind #[cfg(feature = "std")] and a test per predicate. Nice catch on the trailing-whitespace fix in the existing doc comments too.
Two things to address before this can be merged:
1. Line endings (the big one). The file got committed with CRLF line endings instead of LF, which is why GitHub is showing this as +924/-810 — git sees every line as changed. When I diff with --ignore-cr-at-eol, the real change is only +116/-2. Could you fix the line endings and force-push? Something like:
git config --global core.autocrlf false
# from your branch:
dos2unix aimdb-core/src/error.rs # or re-save the file as LF in your editor
git add aimdb-core/src/error.rs
git commit --amend --no-edit
git push --force-with-lease2. Doc comments on the new predicates. The existing is_network_error / is_capacity_error / is_hardware_error each have a one-line /// doc comment. The new predicates are missing them, please add one per predicate to keep the style consistent (see inline comment).
Once those two are addressed I'll re-review. Appreciate the contribution!
| matches!(self, DbError::HardwareError { .. }) | ||
| } | ||
|
|
||
| pub fn is_buffer_error(&self) -> bool { |
There was a problem hiding this comment.
Could you add a one-line /// doc comment on each of the new predicates (is_buffer_error, is_database_error, is_configuration_error, is_runtime_error, is_transform_error, is_io_error, is_json_error) to match the style of the existing is_network_error / is_capacity_error / is_hardware_error above? Something like /// Returns true if this is a buffer-related error is enough.
|
Perfect @lxsaah , I did: and commented "///" for every is_*_error for commiting: |
lxsaah
left a comment
There was a problem hiding this comment.
Thanks, the diff looks clean now!
|
@lxsaah, Do you need anything else? |
|
Thanks so much for your help @ggmaldo , really appreciated! Feel free to pick another issue that interests you and I'll assign it to you. Hopefully this weekend I'll have some more time for triage. I'm planning to split the larger issues into smaller, more focused ones, so there will be even more to pick from soon. On my end, I'm currently working on some content to make the framework more popular and get more visibility for it. You can check out the blog here: https://aimdb.dev/blog One thing that would really help: if you could ask your fellow devs to star the repo, that would bring some great traction to the project! Every star counts |
Description
Added the missing
is_*predicate methods toDbErrorto match the existing pattern ofis_network_error,is_capacity_errorandis_hardware_error.New predicates:
is_buffer_erroris_database_erroris_configuration_erroris_runtime_erroris_transform_erroris_io_error(std only)is_json_error(std only)Each predicate has a corresponding unit test.
How to test
Related Issue