{"record":{"id":"117d699afee00739","repo":"ppy/osu","slug":"invalid-result-type-result","errorCode":null,"errorMessage":"Invalid result type: {result}","messagePattern":"Invalid result type: (.+?)","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"osu.Game.Rulesets.Taiko/UI/HitExplosion.cs","lineNumber":114,"sourceCode":"\r\n            LifetimeEnd = skinnable.Drawable.LatestTransformEndTime;\r\n        }\r\n\r\n        private static TaikoSkinComponents getComponentName(HitResult result)\r\n        {\r\n            switch (result)\r\n            {\r\n                case HitResult.Miss:\r\n                    return TaikoSkinComponents.TaikoExplosionMiss;\r\n\r\n                case HitResult.Ok:\r\n                    return TaikoSkinComponents.TaikoExplosionOk;\r\n\r\n                case HitResult.Great:\r\n                    return TaikoSkinComponents.TaikoExplosionGreat;\r\n            }\r\n\r\n            throw new ArgumentOutOfRangeException(nameof(result), $\"Invalid result type: {result}\");\r\n        }\r\n\r\n        public void VisualiseSecondHit(JudgementResult judgementResult)\r\n        {\r\n            secondHitTime = judgementResult.TimeAbsolute;\r\n            runAnimation();\r\n        }\r\n    }\r\n}\r\n","sourceCodeStart":96,"sourceCodeEnd":124,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game.Rulesets.Taiko/UI/HitExplosion.cs#L96-L124","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Filter HitResult values before creating a HitExplosion — only pass Miss, Ok, or Great.","If a new result tier should produce an explosion, add a case mapping it to a TaikoSkinComponents explosion type.","For non-explosion results, skip the HitExplosion creation entirely rather than passing the result through."],"exampleFix":"// before\nvar explosion = new HitExplosion(result.Type); // throws for non-standard results\n\n// after — guard against unsupported results\nif (result.Type is HitResult.Miss or HitResult.Ok or HitResult.Great)\n    AddInternal(new HitExplosion(result.Type));\nelse\n    return; // no explosion for this result tier","handlingStrategy":"type-guard","validationCode":"// Filter to explosion-capable results before creating HitExplosion\nstatic bool IsExplosionResult(HitResult result)\n    => result is HitResult.Miss or HitResult.Ok or HitResult.Great;","typeGuard":"static bool IsExplosionResult(HitResult result)\n    => result is HitResult.Miss or HitResult.Ok or HitResult.Great;","tryCatchPattern":null,"preventionTips":["Filter HitResult values before creating HitExplosion — only Miss, Ok, and Great produce explosions.","When adding a new HitResult tier to Taiko, decide whether it needs an explosion and add the case if so.","Add a test that iterates all supported HitResult values through GetResultComponent."],"tags":["taiko-ruleset","judgement","enum-exhaustiveness","hit-explosion"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}