From fdf79df4c083a6f9a7d8437102433326d980558f Mon Sep 17 00:00:00 2001 From: Norbyte Date: Sun, 5 Jan 2020 20:06:05 +0100 Subject: [PATCH] Shorten updater error messages --- OsiLoader/dllmain.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/OsiLoader/dllmain.cpp b/OsiLoader/dllmain.cpp index 3ac23e3b..75847351 100644 --- a/OsiLoader/dllmain.cpp +++ b/OsiLoader/dllmain.cpp @@ -44,7 +44,7 @@ class OsiLoader if (!updated && !ExtenderDLLExists()) { completed_ = true; - auto msg = FromUTF8("Osiris Extender initialization failed:\r\n" + reason); + auto msg = FromUTF8(reason); gErrorUtils->ShowError(msg.c_str()); return; } @@ -60,8 +60,7 @@ class OsiLoader if (handle == NULL) { auto errc = GetLastError(); - std::wstring errmsg = L"Osiris Extender initialization failed:\r\n" - "Unable to load extender DLL.\r\n" + std::wstring errmsg = L"Script Extender DLL load failed.\r\n" "Error code: "; errmsg += std::to_wstring(errc); gErrorUtils->ShowError(errmsg.c_str()); @@ -76,8 +75,7 @@ class OsiLoader std::string etag; if (!fetcher.FetchETag(packageUri.c_str(), etag)) { - reason = "Something went wrong while checking for updates. Please make sure you're connected to the internet and try again\r\n"; - reason += "ETag fetch failed.\r\n"; + reason = "Something went wrong while checking for Script Extender updates. Please make sure you're connected to the internet and try again\r\n"; reason += fetcher.GetLastError(); return false; } @@ -89,8 +87,7 @@ class OsiLoader std::vector response; if (!fetcher.Fetch(packageUri.c_str(), response)) { - reason = "Something went wrong while downloading updates. Please make sure you're connected to the internet and try again\r\n"; - reason += "Update payload fetch failed.\r\n"; + reason = "Something went wrong while downloading Script Extender updates. Please make sure you're connected to the internet and try again\r\n"; reason += fetcher.GetLastError(); return false; } @@ -105,15 +102,15 @@ class OsiLoader return true; } else { if (hr == S_FALSE) { - reason = "Unable to extract update package.\r\n"; + reason = "Unable to extract Script Extender update package.\r\n"; reason += unzipReason; } else { _com_error err(hr); LPCTSTR errMsg = err.ErrorMessage(); std::stringstream ss; - ss << "Unable to extract update package.\r\n" - << "UnzipToFolder returned HRESULT 0x" + ss << "Unable to extract Script Extender update package.\r\n" + << "HRESULT 0x" << std::hex << std::setw(8) << std::setfill('0') << hr; if (errMsg != nullptr) { ss << ": " << ToUTF8(errMsg);