Convert the archive writer to use Error.

This found one place in lld that was not checking the error.

llvm-svn: 313937
diff --git a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
index a7268d0..f5cf848 100644
--- a/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ b/llvm/lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -157,13 +157,13 @@
 
   // Create an archive file.
   std::string OutputPath = getOutputPath(&Args, Members[0]);
-  std::error_code EC =
-      writeArchive(OutputPath, Members,
-                   /*WriteSymtab=*/true, object::Archive::K_GNU,
-                   /*Deterministic*/ true, Args.hasArg(OPT_llvmlibthin));
-
-  if (EC) {
-    llvm::errs() << OutputPath << ": " << EC.message() << "\n";
+  if (Error E =
+          writeArchive(OutputPath, Members,
+                       /*WriteSymtab=*/true, object::Archive::K_GNU,
+                       /*Deterministic*/ true, Args.hasArg(OPT_llvmlibthin))) {
+    handleAllErrors(std::move(E), [&](const ErrorInfoBase &EI) {
+      llvm::errs() << OutputPath << ": " << EI.message() << "\n";
+    });
     return 1;
   }