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

Properly Propagate Protocol Problems (tcp::Error -> embeded_io::Error) #1801

Closed
avlec opened this issue Aug 18, 2023 · 2 comments · Fixed by #1802
Closed

Properly Propagate Protocol Problems (tcp::Error -> embeded_io::Error) #1801

avlec opened this issue Aug 18, 2023 · 2 comments · Fixed by #1802
Labels
e-net kind-bug Something isn't working

Comments

@avlec
Copy link
Contributor

avlec commented Aug 18, 2023

Currently there's no error translation for converting from embassy_net::tcp::Error to embedded_io::Error.
It is rather concerning to get a "Other" as an Error value instead of useful information that you have to get by breaking at the conversion spot in tcp.rs

impl embedded_io_async::Error for ConnectError {

I was seeing the embedded_io Other error when under the hood the actual error was ConnectionReset, which the function above converts to Other which loses all meaning.

@Dirbaio
Copy link
Member

Dirbaio commented Aug 18, 2023

Agreed. This code predates adding all the variants to embedded_io_async::ErrorKind rust-embedded/embedded-hal#471, that's why it's this way. PR's welcome!

(also note you can inspect the ConnectError directly, you don't need to do .kind())

@avlec
Copy link
Contributor Author

avlec commented Aug 18, 2023

Yes, I was trying to get reqwless http lib to work, stumbled across this translation error when doing a debugger to a RP Pico W. So I was using a commit from this project from 2 weeks ago, and see that the 0.4 version of embedded_io at that point only had Other. So I could only see the error from the very outside, behind an HttpClient request returning an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e-net kind-bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants