From 5a8a24e936d5d8015883ca91e0935a9216a14d92 Mon Sep 17 00:00:00 2001 From: YoshiRulz <OSSYoshiRulz@gmail.com> Date: Tue, 19 Jul 2022 08:26:09 +1000 Subject: [PATCH] Enable MA0054 and fix noncompliance "Embed the caught exception as innerException" --- Common.ruleset | 2 +- src/BizHawk.Client.Common/XmlGame.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Common.ruleset b/Common.ruleset index ec6c561a34..b28bc6ec93 100644 --- a/Common.ruleset +++ b/Common.ruleset @@ -270,7 +270,7 @@ <Rule Id="MA0053" Action="Hidden" /> <!-- Embed the caught exception as innerException --> - <Rule Id="MA0054" Action="Hidden" /> + <Rule Id="MA0054" Action="Error" /> <!-- Do not use finalizer --> <Rule Id="MA0055" Action="Hidden" /> diff --git a/src/BizHawk.Client.Common/XmlGame.cs b/src/BizHawk.Client.Common/XmlGame.cs index ac109183a7..0e8d97f307 100644 --- a/src/BizHawk.Client.Common/XmlGame.cs +++ b/src/BizHawk.Client.Common/XmlGame.cs @@ -90,9 +90,9 @@ namespace BizHawk.Client.Common data = File.ReadAllBytes(fullPath.Split('|').First()); } } - catch + catch (Exception e) { - throw new Exception($"Couldn't load XMLGame LoadAsset \"{filename}\""); + throw new Exception($"Couldn't load XMLGame LoadAsset \"{filename}\"", e); } }