From 49653c56bd5b9c7b8ad459b278634ddbb9115a74 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Oct 2020 15:27:12 +0200 Subject: Handle case where io_error not derived from system_error --- bbot/worker/worker.cxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/bbot/worker/worker.cxx b/bbot/worker/worker.cxx index 6edadcc..26fa26b 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -1396,24 +1396,29 @@ build (size_t argc, const char* argv[]) c.out.close (); if (!c.wait ()) throw_generic_error (EIO); + + // We use exit code 2 to signal abnormal termination but where we managed + // to upload the result manifest. See startup() for details. + // + return rm.status != result_status::abnormal ? 0 : 2; } catch (const manifest_serialization& e) { fail << "invalid result manifest: " << e.description; } + catch (const io_error& e) // In case not derived from system_error. + { + error << "unable to upload result manifest to " << url << ": " << e; + } catch (const system_error& e) { - // We use exit code 3 to signal an unsuccessful attempt to upload the - // result manifest. See startup() for details. - // error << "unable to upload result manifest to " << url << ": " << e; - return 3; } - // We use exit code 2 to signal abnormal termination but where we managed - // to upload the result manifest. See startup() for details. + // We use exit code 3 to signal an unsuccessful attempt to upload the result + // manifest. See startup() for details. // - return rm.status != result_status::abnormal ? 0 : 2; + return 3; } static int -- cgit v1.1