Log all non-cancellation errors in difficulty cache

This commit is contained in:
Bartłomiej Dach 2021-11-20 17:32:40 +01:00
parent 6100bf66a6
commit a7e45a9098
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

View File

@ -294,15 +294,22 @@ namespace osu.Game.Beatmaps
return new StarDifficulty(attributes);
}
catch (BeatmapInvalidForRulesetException e)
catch (OperationCanceledException)
{
// no need to log, cancellations are expected as part of normal operation.
return null;
}
catch (BeatmapInvalidForRulesetException invalidForRuleset)
{
if (rulesetInfo.Equals(beatmapInfo.Ruleset))
Logger.Error(e, $"Failed to convert {beatmapInfo.OnlineID} to the beatmap's default ruleset ({beatmapInfo.Ruleset}).");
Logger.Error(invalidForRuleset, $"Failed to convert {beatmapInfo.OnlineID} to the beatmap's default ruleset ({beatmapInfo.Ruleset}).");
return null;
}
catch
catch (Exception unknownException)
{
Logger.Error(unknownException, "Failed to calculate beatmap difficulty");
return null;
}
}