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

Use io::Error for public error type #553

Merged
merged 1 commit into from
Apr 13, 2021

Conversation

Plecra
Copy link
Contributor

@Plecra Plecra commented Mar 27, 2021

This makes interoperation with the standard library much easier for users, which is especially useful given crossterm's low level APIs.

A custom error type is only useful if the context it provides outweighs its ergonomic burden, and in this case only the ResizingTerminalFailure and SettingTerminalTitleFailure variants were being used.

Do we have examples of these variants being used in dependent code? I can add them to the new representation if so.

@Plecra Plecra requested a review from TimonPost as a code owner March 27, 2021 22:29
@TimonPost
Copy link
Member

I agree, the error types we have currently do not really add that much value. Thanks for the pull request. Give it a look in a bit.

@TimonPost TimonPost merged commit 58f580e into crossterm-rs:master Apr 13, 2021
yykamei added a commit to yykamei/thwack that referenced this pull request Jun 20, 2021
Summary:

Bump crossterm from 0.19.0 to 0.20.0. This requires extra work to remove
`impl From<crossterm::ErrorKind> for Error` because `crossterm::ErrorKind`
became just an alias of `io::Error`. We don't have to convert crossterm
specific errors. See crossterm-rs/crossterm#553
for more details.

Release note:

https://github.com/crossterm-rs/crossterm/releases

Changelog:

https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md
yykamei added a commit to yykamei/thwack that referenced this pull request Jun 20, 2021
Summary:

Bump crossterm from 0.19.0 to 0.20.0. This requires extra work to remove
`impl From<crossterm::ErrorKind> for Error` because `crossterm::ErrorKind`
became just an alias of `io::Error`. We don't have to convert crossterm
specific errors. See crossterm-rs/crossterm#553
for more details.

Release note:

https://github.com/crossterm-rs/crossterm/releases

Changelog:

https://github.com/crossterm-rs/crossterm/blob/master/CHANGELOG.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants