Standardise usages of exceptions.

This commit is contained in:
Huo Yaoyuan
2017-05-07 00:38:17 +08:00
parent 91ad0cb75e
commit 4f8549f220
6 changed files with 9 additions and 9 deletions

View File

@ -90,7 +90,7 @@ namespace osu.Game.Screens.Play
Beatmap = beatmaps.GetWorkingBeatmap(BeatmapInfo, withStoryboard: true);
if (Beatmap?.Beatmap == null)
throw new Exception("Beatmap was not loaded");
throw new InvalidOperationException("Beatmap was not loaded");
ruleset = osu?.Ruleset.Value ?? Beatmap.BeatmapInfo.Ruleset;
rulesetInstance = ruleset.CreateInstance();
@ -109,7 +109,7 @@ namespace osu.Game.Screens.Play
}
if (!HitRenderer.Objects.Any())
throw new Exception("Beatmap contains no hit objects!");
throw new InvalidOperationException("Beatmap contains no hit objects!");
}
catch (Exception e)
{