Fix exception throw (#28104)

* fix exception throw

* fix settings crash

* throw runtime_error
This commit is contained in:
Davide Giacometti 2023-08-24 14:53:48 +02:00 committed by GitHub
parent 83143169c6
commit 738072f508
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 18 deletions

View File

@ -192,7 +192,7 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
}
else
{
throw;
throw std::runtime_error("Invalid Activation Method value");
}
}
@ -258,7 +258,7 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
}
else
{
throw;
throw std::runtime_error("Invalid Overlay Opacity value");
}
}
catch (...)
@ -276,7 +276,7 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
}
else
{
throw;
throw std::runtime_error("Invalid Spotlight Radius value");
}
}
catch (...)
@ -294,7 +294,7 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
}
else
{
throw;
throw std::runtime_error("Invalid Animation Duration value");
}
}
catch (...)
@ -312,7 +312,7 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
}
else
{
throw;
throw std::runtime_error("Invalid Spotlight Initial Zoom value");
}
}
catch (...)
@ -355,7 +355,7 @@ void FindMyMouse::parse_settings(PowerToysSettings::PowerToyValues& settings)
}
else
{
throw;
throw std::runtime_error("Invalid Shaking Minimum Distance value");
}
}
catch (...)

View File

@ -238,7 +238,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Opacity value");
}
}
catch (...)
@ -314,7 +314,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Radius value");
}
}
catch (...)
@ -332,7 +332,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Fade Delay value");
}
}
catch (...)
@ -350,7 +350,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Fade Duration value");
}
}
catch (...)

View File

@ -233,7 +233,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Opacity value");
}
}
catch (...)
@ -270,7 +270,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Radius value");
}
}
@ -289,7 +289,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Thickness value");
}
}
@ -327,7 +327,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Border Color value");
}
}
catch (...)
@ -366,7 +366,7 @@ public:
}
else
{
throw;
throw std::runtime_error("Invalid Fixed Length value");
}
}
catch (...)

View File

@ -342,7 +342,7 @@ private:
}
else
{
throw;
throw std::runtime_error("Invalid Press Time Windows Shortcuts value");
}
value = static_cast<int>(jsonPressTimeForTaskbarIconShortcutsObject.GetNamedNumber(L"value"));
if (value >= 0)
@ -351,7 +351,7 @@ private:
}
else
{
throw;
throw std::runtime_error("Invalid Press Time Taskbar Shortcuts value");
}
}
catch (...)

View File

@ -48,7 +48,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
}
FindMyMouseSettingsConfig = findMyMouseSettingsRepository.SettingsConfig;
_findMyMouseActivationMethod = FindMyMouseSettingsConfig.Properties.ActivationMethod.Value;
_findMyMouseActivationMethod = FindMyMouseSettingsConfig.Properties.ActivationMethod.Value < 2 ? FindMyMouseSettingsConfig.Properties.ActivationMethod.Value : 0;
_findMyMouseDoNotActivateOnGameMode = FindMyMouseSettingsConfig.Properties.DoNotActivateOnGameMode.Value;
string backgroundColor = FindMyMouseSettingsConfig.Properties.BackgroundColor.Value;