Skip to content

Commit dc3d2be

Browse files
committed
Log and catch more exception when changing themes
1 parent fabc7b2 commit dc3d2be

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,19 @@ public bool ChangeTheme(string theme = null)
449449
}
450450
return false;
451451
}
452-
catch (XamlParseException)
452+
catch (XamlParseException e)
453453
{
454-
_api.LogError(ClassName, $"Theme <{theme}> fail to parse");
454+
_api.LogException(ClassName, $"Theme <{theme}> fail to parse xaml", e);
455+
if (theme != Constant.DefaultTheme)
456+
{
457+
_api.ShowMsgBox(Localize.theme_load_failure_parse_error(theme));
458+
ChangeTheme(Constant.DefaultTheme);
459+
}
460+
return false;
461+
}
462+
catch (Exception e)
463+
{
464+
_api.LogException(ClassName, $"Theme <{theme}> fail to load", e);
455465
if (theme != Constant.DefaultTheme)
456466
{
457467
_api.ShowMsgBox(Localize.theme_load_failure_parse_error(theme));

0 commit comments

Comments
 (0)