Skip to content
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

Refine Display and Source implementation for error types #5439

Merged
merged 4 commits into from
Feb 29, 2024

Conversation

BugenZhao
Copy link
Contributor

@BugenZhao BugenZhao commented Feb 27, 2024

Which issue does this PR close?

Closes #5438.

Rationale for this change

Check the issue for the motivation. Also update the source implementation to make it consistent with the changes on Display.

- If there's a prompt ahead of formatting the inner error, provide it as a source error. This is similar to #[source] or #[from] in thiserror.
- If there's no prompt but we directly forward the method to the inner error, also forward the source method. This is similar to #[transparent] in thiserror.

What changes are included in this PR?

Are there any user-facing changes?

The description and source of ArrowError and FlightError get updated.

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@github-actions github-actions bot added arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate labels Feb 27, 2024
Copy link
Contributor

@Jefffrey Jefffrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense, thanks 👍

Looks like you'll need to fix a bunch of the tests, however

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao requested a review from Jefffrey February 28, 2024 06:55
Copy link
Contributor

@Jefffrey Jefffrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for this 👍

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @BugenZhao

Signed-off-by: Bugen Zhao <i@bugenzhao.com>
@BugenZhao BugenZhao requested a review from tustvold February 29, 2024 08:48
@tustvold tustvold merged commit 877e870 into apache:master Feb 29, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refine Display implementation for FlightError
4 participants