mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Fix exception throw (#28104)
* fix exception throw * fix settings crash * throw runtime_error
This commit is contained in:
committed by
GitHub
parent
83143169c6
commit
738072f508
@@ -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 (...)
|
||||
|
||||
@@ -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 (...)
|
||||
|
||||
@@ -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 (...)
|
||||
|
||||
@@ -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 (...)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user