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
A builder's build() method returns a Result::<_, Box<dyn std::error::Error>> type. That isn't Send or Sync, which makes it difficult to use. For example, it can't be used with anyhow::Context. Would it be possible to make the error type a little bit more specific, like Box<dyn Error + Send + Sync>?
The text was updated successfully, but these errors were encountered:
Ah yes, I need re-evaluate error handling in this library a little bit.
@asomers I might replace this error type with anyhow::Error. I think I just did Box<dyn std::error::Error> to focus on other parts and forgot to change it.
btw we're on the same discord server for freebsd, feel free to message me there.
The author of anyhow doesn't recommend its use in libraries, only in applications. For libraries, he recommends returning a custom enum, possibly generated with thiserror (by the same author).
The author of anyhow doesn't recommend its use in libraries, only in applications. For libraries, he recommends returning a custom enum, possibly generated with thiserror (by the same author).
I think it's more about can this error be handled or not. I need to take a look at what errors can be returned by builder and see if I can neatly organize it with thiserror or swap to anyhow (closer to how it works now)
A builder's
build()
method returns aResult::<_, Box<dyn std::error::Error>>
type. That isn'tSend
orSync
, which makes it difficult to use. For example, it can't be used withanyhow::Context
. Would it be possible to make the error type a little bit more specific, likeBox<dyn Error + Send + Sync>
?The text was updated successfully, but these errors were encountered: