From dd4393647c51e75abeea8cd3e516ca1ed2bd23f3 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 85b3265..17c4fa9 100644 --- a/bbot/worker/worker.cxx +++ b/bbot/worker/worker.cxx @@ -1443,24 +1443,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