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
I am using anyhow in a CLI project, which filters out broken pipe errors at the top level main. When writing JSON directly to a closed stdout the returned root_cause is the JSON ser::Error itself, not the underlying io::Error.
It turns out, the implementation of Error::source for ser::Error does not return the actual source of the JSON Error, but the transitive source of its inner io::Error. This was introduced in #992.
I think it would probably be better to return the correct Error::source and simply format the io case for ser::Error as an io error occured to avoid the dupe message.
The text was updated successfully, but these errors were encountered:
tingerrr
changed the title
Error completely hides io::Errorser::Error completely hides inner io::ErrorAug 7, 2024
I am using
anyhow
in a CLI project, which filters out broken pipe errors at the top level main. When writing JSON directly to a closedstdout
the returnedroot_cause
is the JSONser::Error
itself, not the underlyingio::Error
.It turns out, the implementation of
Error::source for ser::Error
does not return the actual source of the JSONError
, but the transitive source of its innerio::Error
. This was introduced in #992.I think it would probably be better to return the correct
Error::source
and simply format theio
case forser::Error
asan io error occured
to avoid the dupe message.The text was updated successfully, but these errors were encountered: