3 ms·
You return an error specific to that function. If it internally has a `InnerFuncErr::WriteFailed` error, you might handle it, and then you don't have to pass i
by j-pb 1y ago
You return an error specific to that function.
If it internally has a `InnerFuncErr::WriteFailed` error, you might handle it, and then you don't have to pass it back at all, or you might wrap it in an `OuterFuncErr::BadIo(inner_err)`or throw it away and make `BadIo` parameterless, if you feel that the caller won't care anyways.
Errors are not Exceptions, you don't fling them across half of your codebase until they crash the process, you try to diligently handle them, and do what makes sense.
So you don't really care about the union.