mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add exception handler
This commit is contained in:
parent
482fdc939f
commit
35ea1e33a9
2 changed files with 20 additions and 4 deletions
|
|
@ -327,6 +327,7 @@
|
|||
<system:String x:Key="clearlogfolderMessage">Are you sure you want to delete all logs?</system:String>
|
||||
<system:String x:Key="clearcachefolder">Clear Caches</system:String>
|
||||
<system:String x:Key="clearcachefolderMessage">Are you sure you want to delete all caches?</system:String>
|
||||
<system:String x:Key="clearfolderfailMessage">Failed to clear folders and files</system:String>
|
||||
<system:String x:Key="welcomewindow">Wizard</system:String>
|
||||
<system:String x:Key="userdatapath">User Data Location</system:String>
|
||||
<system:String x:Key="userdatapathToolTip">User settings and installed plugins are saved in the user data folder. This location may vary depending on whether it's in portable mode or not.</system:String>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,15 @@ public partial class SettingsPaneAboutViewModel : BaseModel
|
|||
|
||||
if (confirmResult == MessageBoxResult.Yes)
|
||||
{
|
||||
ClearLogFolder();
|
||||
try
|
||||
{
|
||||
ClearLogFolder();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
App.API.LogException(nameof(SettingsPaneAboutViewModel), "Failed to clear log folder", e);
|
||||
App.API.ShowMsgBox(App.API.GetTranslation("clearfolderfailMessage"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +126,15 @@ public partial class SettingsPaneAboutViewModel : BaseModel
|
|||
|
||||
if (confirmResult == MessageBoxResult.Yes)
|
||||
{
|
||||
ClearCacheFolder();
|
||||
try
|
||||
{
|
||||
ClearCacheFolder();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
App.API.LogException(nameof(SettingsPaneAboutViewModel), "Failed to clear cache folder", e);
|
||||
App.API.ShowMsgBox(App.API.GetTranslation("clearfolderfailMessage"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -202,8 +218,7 @@ public partial class SettingsPaneAboutViewModel : BaseModel
|
|||
|
||||
foreach (string order in orders)
|
||||
{
|
||||
if (bytes > max)
|
||||
return $"{decimal.Divide(bytes, max):##.##} {order}";
|
||||
if (bytes > max) return $"{decimal.Divide(bytes, max):##.##} {order}";
|
||||
|
||||
max /= scale;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue