Closed ids1024 closed 9 months ago
The error returned by polling
could be a lot more informative as to the cause of this error.
cc @ivmarkov
I guess the root cause is this call failing.
Any suggestions what to do there (I'm not very good at dealing with std::io::Error
).
Not sure if possible to decorate it at all with a human readable message (something like "Did you initialize the VFS subsystem of ESP IDF and do you have enough event handles"?).
io::Error
is a kind of weird API, but it's flexible enough. It would be sufficient to catch the PermissionDenied
then call io::Error::new
with the same ErrorKind
(or a different one) and a string with a specific message. Or define a new error type to pass to io::Error::new
here.
Maybe you can contribute a PR with that? :) (I'm completely underwater trying to fix, "example"-ify and release the new version of the esp-idf-*
crates, so any help would be greatly appreciated.)
Btw, this is coming in the new release, so you don't need to call into the unsafe esp-idf-sys
APIs for the eventfd
VFS initialization anymore.
I'm not sure if something was different when this was added to polling, but trying with a simple project based on https://github.com/esp-rs/esp-idf-template on nightly Rust, the call to
eventfd
fails.Looking at https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/vfs.html#eventfd, it seems some additional code is needed to support
eventfd
. Which I see works with something like this:Not sure what polling can do here. Other than documentation? Or maybe produce a more useful error.