refactor(binding/python): Add multiple custom exception for each of error code in Rust Core#3492
refactor(binding/python): Add multiple custom exception for each of error code in Rust Core#3492
Conversation
…rror code in Rust Core Signed-off-by: Manjusaka <me@manjusaka.me>
5242d1c to
d95d518
Compare
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
messense
left a comment
There was a problem hiding this comment.
I think there should still be a catch-all opendal Exception just like the original Error type, other exceptions should subclass from it, forming an exception hierarchy.
See also PyO3/pyo3#3452
So we will have |
Exactly, to catch any opendal exception, user should not need to catch A good exception hierarchy example is https://github.com/psf/requests/blob/main/src/requests/exceptions.py |
SGTM |
Signed-off-by: Manjusaka <me@manjusaka.me>
messense
left a comment
There was a problem hiding this comment.
Can we also add a test case to ensure that catching any opendal exception using Error works?
Signed-off-by: Manjusaka <me@manjusaka.me>
This reverts commit 1d7d5a7.
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka me@manjusaka.me