Replace some reportError() calls with error propagation that was missed from rL352625.
Note this also adds an error check during Archive iteration that was being hidden by a different error check before:
for (const Archive::Child &Child : Ar.children(Err)) { Expected<std::unique_ptr<Binary>> ChildOrErr = Child.getAsBinary(); if (!ChildOrErr) // This aborts, so Err is never checked reportError(Ar.getFileName(), ChildOrErr.takeError());
Err is being checked after the loop, so during happy runs, everything is fine. But when reportError is changed to return the error instead of aborting, the fact that Err is never checked is now noticed in tests that trigger an error during the loop.
Can this happen? I thought usually the iterator would exit out - rather than giving a valid Child while also providing an error?
Or is this to workaround the "Error is not checked on early returns"? If that's the issue, we should fix the iterator - as per the thread I pulled @lhames into a while back, I think?