1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-02 07:29:54 +08:00

Adjust logging to still expose the underlying exception

This commit is contained in:
Dean Herbert
2023-09-27 16:55:03 +09:00
Unverified
parent d1d82d2b49
commit 3708e79577
+6 -6
View File
@@ -52,19 +52,19 @@ namespace osu.Game.Scoring
{
return new DatabasedLegacyScoreDecoder(rulesets, beatmaps()).Parse(stream).ScoreInfo;
}
catch (LegacyScoreDecoder.BeatmapNotFoundException e)
catch (LegacyScoreDecoder.BeatmapNotFoundException notFound)
{
Logger.Log($@"Score '{archive.Name}' failed to import: no corresponding beatmap with the hash '{e.Hash}' could be found.", LoggingTarget.Database);
Logger.Log($@"Score '{archive.Name}' failed to import: no corresponding beatmap with the hash '{notFound.Hash}' could be found.", LoggingTarget.Database);
// In the case of a missing beatmap, let's attempt to resolve it and show a prompt to the user to download the required beatmap.
var req = new GetBeatmapRequest(new BeatmapInfo { MD5Hash = e.Hash });
req.Success += res => PostNotification?.Invoke(new MissingBeatmapNotification(res, archive, e.Hash));
var req = new GetBeatmapRequest(new BeatmapInfo { MD5Hash = notFound.Hash });
req.Success += res => PostNotification?.Invoke(new MissingBeatmapNotification(res, archive, notFound.Hash));
api.Queue(req);
return null;
}
catch (Exception)
catch (Exception e)
{
Logger.Log($@"Score '{archive.Name}' failed to import: failed to parse replay headers.", LoggingTarget.Database);
Logger.Log($@"Failed to parse headers of score '{archive.Name}': {e}.", LoggingTarget.Database);
return null;
}
}