[FancyZones] Initial improvements in FancyZones exception handling (#6063)

* Initial improvements in FancyZones exception handling

* Add callback

* Disable FancyZones if error durign loading data occurrs

* Remove logs

* Add resource strings

* Add 1sec retry when failure during initialization occurs

* Rephrase error descriptions

* Error handling during loading of module in runner

* Pass error handling on the runner

* Remove unneeded string

* Remove unnedeed changes
This commit is contained in:
vldmr11080
2020-09-18 15:18:01 +02:00
committed by GitHub
parent 2bc3480396
commit 3aa7a52c21
9 changed files with 153 additions and 86 deletions

View File

@@ -41,6 +41,8 @@ namespace localized_strings
const wchar_t DOWNLOAD_UPDATE_ERROR[] = L"Couldn't download PowerToys update! Please report the issue on Github.";
const wchar_t OLDER_MSIX_UNINSTALLED[] = L"An older MSIX version of PowerToys was uninstalled.";
const wchar_t PT_UPDATE_MESSAGE_BOX_TEXT[] = L"PowerToys was updated successfully!";
const wchar_t POWER_TOYS[] = L"PowerToys";
const wchar_t POWER_TOYS_MODULE_LOAD_FAIL[] = L"Failed to load "; // Module name will be appended on this message and it is not localized.
}
namespace
@@ -136,6 +138,11 @@ int runner(bool isProcessElevated)
}
catch (...)
{
std::wstring errorMessage = std::wstring(localized_strings::POWER_TOYS_MODULE_LOAD_FAIL) + moduleSubdir.data();
MessageBox(NULL,
errorMessage.c_str(),
localized_strings::POWER_TOYS,
MB_OK | MB_ICONERROR);
}
}
// Start initial powertoys

View File

@@ -20,7 +20,7 @@ PowertoyModule load_powertoy(const std::wstring_view filename)
if (!module)
{
FreeLibrary(handle);
winrt::throw_last_error();
winrt::throw_hresult(winrt::hresult(E_POINTER));
}
return PowertoyModule(module, handle);
}