[llvm-objcopy][NFC] More error propagation (executeObjcopyOnArchive)

Summary:
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.

Reviewers: jhenderson, dblaikie, alexshap

Reviewed By: dblaikie

Subscribers: llvm-commits, lhames, jakehehrlich

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D57462

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352888 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed