You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This crate has a poor error handling because if C library returns null pointer or code < 0 it just uses the last io error. The problem is that user can't realize where and why he got, for example, error No such file or directory (os error 2). It's great that after merge #7 we will get at least poor error handling, but any way we should add meaningful error messages because we know where this error is possible.
How I see it, at now that's c_result function which checks result value and return back the Ok(..) or Err(..), we can add one more parameter there to use additional context (look at anyhow crate).
The text was updated successfully, but these errors were encountered:
I agree the no such file or directory error is difficult for users to debug. I've run into this a number of times. I do like how anyhow adds additional context to the errors to make it easier to figure out what broke.
This crate has a poor error handling because if C library returns null pointer or code < 0 it just uses the last io error. The problem is that user can't realize where and why he got, for example, error
No such file or directory (os error 2)
. It's great that after merge #7 we will get at least poor error handling, but any way we should add meaningful error messages because we know where this error is possible.How I see it, at now that's
c_result
function which checks result value and return back theOk(..)
orErr(..)
, we can add one more parameter there to use additional context (look atanyhow
crate).The text was updated successfully, but these errors were encountered: