mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 03:37:59 +01:00
[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:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user