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

Add underlying std::io::Error to IoError and add IpcError variant #4726

Merged
merged 1 commit into from
Aug 24, 2023

Conversation

alexandreyc
Copy link
Contributor

Which issue does this PR close?

Does not close any open issue.

Rationale for this change

I need to handle some kind of I/O errors (notably broken pipe errors) specifically and the current IoError variant does not permit it because it does not expose the underlying std::io::Error. Moreover, it looks to me that IoError is a bit misused, mostly in the IPC format and Flight crates. I introduced a new IpcError variant to have a better semantics of errors.

What changes are included in this PR?

  • Add std::io::Error field to IoError variant
  • Add IpcError variant to ArrowError
  • Update conversion traits
  • Replace usage of IoError within the IPC / Flights crates

I'm not 100% sure about the new semantics of every errors so feel to correct me.

Are there any user-facing changes?

Yes. Callers that handle IoError separately will need to update their patterns to include the new field and they will also need to handle the new IpcError variant.

@github-actions github-actions bot added arrow Changes to the arrow crate arrow-flight Changes to the arrow-flight crate labels Aug 23, 2023
@alexandreyc
Copy link
Contributor Author

alexandreyc commented Aug 23, 2023

Just closed #4723 which was an earlier version of this.

@tustvold tustvold added the api-change Changes to the arrow API label Aug 23, 2023
Copy link
Contributor

@tustvold tustvold left a comment

Choose a reason for hiding this comment

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

Makes sense to me, I think longer term we probably want to revisit the way that errors are handled. I do wonder if we would be better served using something like anyhow... #2725

@tustvold tustvold merged commit d9381c6 into apache:master Aug 24, 2023
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API 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.

None yet

2 participants