ppy/osu · error · ArgumentOutOfRangeException

Invalid result type: {result}

Error message

Invalid result type: {result}

What it means

HitExplosion.GetResultComponent() maps a HitResult to the corresponding TaikoSkinComponents explosion type. Only Miss, Ok, and Great are valid for Taiko hit explosions. Other result values (e.g., Meh, Good, Perfect, IgnoreHit, SmallBonusHit) are invalid for this visual component and throw ArgumentOutOfRangeException.

Source

Thrown at osu.Game.Rulesets.Taiko/UI/HitExplosion.cs:114

            LifetimeEnd = skinnable.Drawable.LatestTransformEndTime;
        }

        private static TaikoSkinComponents getComponentName(HitResult result)
        {
            switch (result)
            {
                case HitResult.Miss:
                    return TaikoSkinComponents.TaikoExplosionMiss;

                case HitResult.Ok:
                    return TaikoSkinComponents.TaikoExplosionOk;

                case HitResult.Great:
                    return TaikoSkinComponents.TaikoExplosionGreat;
            }

            throw new ArgumentOutOfRangeException(nameof(result), $"Invalid result type: {result}");
        }

        public void VisualiseSecondHit(JudgementResult judgementResult)
        {
            secondHitTime = judgementResult.TimeAbsolute;
            runAnimation();
        }
    }
}

View on GitHub (pinned to d9c73e12ad)

Solutions

  1. Filter HitResult values before creating a HitExplosion — only pass Miss, Ok, or Great.
  2. If a new result tier should produce an explosion, add a case mapping it to a TaikoSkinComponents explosion type.
  3. For non-explosion results, skip the HitExplosion creation entirely rather than passing the result through.

Example fix

// before
var explosion = new HitExplosion(result.Type); // throws for non-standard results

// after — guard against unsupported results
if (result.Type is HitResult.Miss or HitResult.Ok or HitResult.Great)
    AddInternal(new HitExplosion(result.Type));
else
    return; // no explosion for this result tier
Defensive patterns

Strategy: type-guard

Validate before calling

// Filter to explosion-capable results before creating HitExplosion
static bool IsExplosionResult(HitResult result)
    => result is HitResult.Miss or HitResult.Ok or HitResult.Great;

Type guard

static bool IsExplosionResult(HitResult result)
    => result is HitResult.Miss or HitResult.Ok or HitResult.Great;

Prevention

When it happens

Trigger: A HitResult value other than Miss, Ok, or Great is passed to GetResultComponent — e.g., a scoring system change introduces additional result tiers, or a custom judgement produces a non-standard result.

Common situations: Custom scoring modes that add result tiers (e.g., a Good or Perfect result); mods that alter available HitResult values; changes to the ScoringValues that expose results the explosion system doesn't handle.

Related errors


AI-assisted analysis of ppy/osu@d9c73e12ad (2026-08-13). Data as JSON: /api/errors/117d699afee00739. Report an issue: GitHub.