diff --git a/frontend/updater/updater.cpp b/frontend/updater/updater.cpp index c15fb3c0a..978a2974f 100644 --- a/frontend/updater/updater.cpp +++ b/frontend/updater/updater.cpp @@ -14,21 +14,22 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "updater.hpp" #include "manifest.hpp" +#include "updater.hpp" #include -#include #include +#include #include +#include #include +#include +#include #include #include -#include #include -#include using namespace std; using namespace updater; @@ -219,11 +220,11 @@ try { WinHandle handle = CreateFile(file, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, nullptr); if (handle == INVALID_HANDLE_VALUE) - throw GetLastError(); + throw LastError(); DWORD written; if (!WriteFile(handle, data, (DWORD)size, &written, nullptr)) - throw GetLastError(); + throw LastError(); return true; @@ -491,7 +492,11 @@ try { return true; +} catch (const exception &e) { + Status(L"Exception: %S", e.what()); + return false; } catch (...) { + Status(L"Unknown exception occurred in RunDownloadWorkers"); return false; } @@ -634,7 +639,11 @@ try { for (auto &result : futures) { result.wait(); } + +} catch (const exception &e) { + Status(L"Exception: %S", e.what()); } catch (...) { + Status(L"Unknown exception occurred in RunHasherWorkers"); } /* ----------------------------------------------------------------------- */ @@ -1075,7 +1084,11 @@ try { return true; +} catch (const exception &e) { + Status(L"Exception: %S", e.what()); + return false; } catch (...) { + Status(L"Unknown exception occurred in RunUpdateWorkers"); return false; }