Improve error dialog when `DiscMountJob` fails

This commit is contained in:
James Groom 2024-04-15 13:10:24 +10:00 committed by GitHub
parent c35aeb992f
commit 8f963ba58c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -27,7 +27,9 @@ namespace BizHawk.Emulation.DiscSystem
if (discMountJob.OUT_ErrorLevel)
{
throw new InvalidOperationException($"\r\n{discMountJob.OUT_Log}");
throw new Exception(string.IsNullOrEmpty(discMountJob.OUT_Log)
? $"Could not process file \"{path}\"."
: $"Could not process file \"{path}\". Warnings/errors:\n{discMountJob.OUT_Log}\n(end disc load log)");
}
var disc = discMountJob.OUT_Disc;