1063 shaares
28 private links
28 private links
7 results
tagged
API設計
Because that way a generic error printer can render out something like
error: Connection error (could not connect to foo) caused by: io error (ECONNRESET)
instead of
error: io error (io error (ECONNRESET)) caused by: io error (ECONNRESET)
Which is what I'm observing frustratingly commonly.
MyErrorEnum::Io(std::io::Error)
ではなく MyErrorEnum::ConnectionError(std::io::Error)
のようにすべきで、前者のような情報を加えないラッパーは面倒という話。
たしかに。