mirror of
https://github.com/ppy/osu.git
synced 2026-06-03 05:30:11 +08:00
Adjust logging to still expose the underlying exception
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user