mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
Centralise logging of failed ruleset loads
This commit is contained in:
parent
e0edaf996f
commit
b0a740071e
@ -5,7 +5,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Extensions.ObjectExtensions;
|
||||
using osu.Framework.Logging;
|
||||
using osu.Framework.Platform;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Database;
|
||||
@ -91,8 +90,7 @@ namespace osu.Game.Rulesets
|
||||
catch (Exception ex)
|
||||
{
|
||||
r.Available = false;
|
||||
Logger.Log($"Could not load ruleset {r.Name}. Please check for an update from the developer.", level: LogLevel.Error);
|
||||
Logger.Log($"Ruleset load failed with {ex.Message}");
|
||||
LogFailedLoad(r.Name, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ namespace osu.Game.Rulesets
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e, $"Failed to load ruleset {filename}");
|
||||
LogFailedLoad(filename, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -158,7 +158,7 @@ namespace osu.Game.Rulesets
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e, $"Failed to add ruleset {assembly}");
|
||||
LogFailedLoad(assembly.FullName, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,6 +173,12 @@ namespace osu.Game.Rulesets
|
||||
AppDomain.CurrentDomain.AssemblyResolve -= resolveRulesetDependencyAssembly;
|
||||
}
|
||||
|
||||
protected void LogFailedLoad(string name, Exception exception)
|
||||
{
|
||||
Logger.Log($"Could not load ruleset {name}. Please check for an update from the developer.", level: LogLevel.Error);
|
||||
Logger.Log($"Ruleset load failed: {exception}");
|
||||
}
|
||||
|
||||
#region Implementation of IRulesetStore
|
||||
|
||||
IRulesetInfo? IRulesetStore.GetRuleset(int id) => GetRuleset(id);
|
||||
|
Loading…
Reference in New Issue
Block a user