Rethrow with debugger attached

This commit is contained in:
duckdoom4
2023-09-12 08:18:57 +02:00
parent ec73251b87
commit 3942dfa4a2

View File

@@ -145,6 +145,10 @@ private void OpenPath(string path, GameVersion gameOverride = GameVersion.Any)
}
catch (Exception ex)
{
// Rethrow to have a better debugging experience
if (Debugger.IsAttached)
throw;
WinFormsUtil.Error($"Failed to open -- {path}", ex.Message);
}
}
@@ -197,6 +201,10 @@ private void OpenFolder(string path, GameVersion gameOverride)
}
catch (Exception ex)
{
// Rethrow to have a better debugging experience
if (Debugger.IsAttached)
throw;
var msg = "Failed to initialize ROM data." + Environment.NewLine +
"Please ensure your dump is correctly set up, with updated patches merged in (if applicable).";
var stack = ex.StackTrace ?? string.Empty;