-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARROW-7312: [Rust] Implement std::error::Error for ArrowError. #5959
Conversation
@andygrove @nevi-me @sunchao @paddyhoran Please help to review. |
rust/arrow/src/error.rs
Outdated
@@ -70,4 +71,12 @@ impl From<::std::string::FromUtf8Error> for ArrowError { | |||
} | |||
} | |||
|
|||
impl Display for ArrowError { | |||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { | |||
write!(f, "Arrow error happened!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not display the type of and details ArrowError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Details should be displayed in debug mode.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand, but perhaps it's because I'm not familiar with the Display trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, I'm with @nevi-me here. His point is that "Arrow error happened!" is not that informative. You would also want to know the variant of the enum and any payload, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks @liurenjie1024. I don't see CI failing but I guess we should wait before merging.
AppVeyor no longer runs any Rust tests, maybe we should remove it from the Rust runs (I haven't checked how it gets triggered though, so maybe that's not possible). Is it possible @kou? |
Rust job on AppVeyor has been migrated to GitHub Actions based job. So we don't need to wait for AppVeyor result for changes that only affects to Rust. FYI: We can disable AppVeyor job check for Rust only changes entirely by the following change: diff --git a/appveyor.yml b/appveyor.yml
index a6d79de7e..cd8617893 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -31,7 +31,6 @@ only_commits:
- python/
- r/
- ruby/
- - rust/
cache:
- C:\Users\Appveyor\clcache1 |
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better. Closes apache#5959 from liurenjie1024/arrow-7312 and squashes the following commits: f27683a <Renjie Liu> Fix comment d3e238d <Renjie Liu> Implement error Authored-by: Renjie Liu <[email protected]> Signed-off-by: Neville Dipale <[email protected]>
Add this implementation so that others can handle errors from arrow crate better.