{"record":{"id":"4bab9beded5d6b87","repo":"ppy/osu","slug":"unsupported-animation-style","errorCode":null,"errorMessage":"Unsupported animation style","messagePattern":"Unsupported animation style","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs","lineNumber":87,"sourceCode":"                    return Easing.In;\r\n\r\n                case AnimationStyle.Accelerate2:\r\n                    return Easing.InCubic;\r\n\r\n                case AnimationStyle.Accelerate3:\r\n                    return Easing.InQuint;\r\n\r\n                case AnimationStyle.Decelerate1:\r\n                    return Easing.Out;\r\n\r\n                case AnimationStyle.Decelerate2:\r\n                    return Easing.OutCubic;\r\n\r\n                case AnimationStyle.Decelerate3:\r\n                    return Easing.OutQuint;\r\n\r\n                default:\r\n                    throw new ArgumentOutOfRangeException(nameof(style), style, @\"Unsupported animation style\");\r\n            }\r\n        }\r\n\r\n        public enum AnimationStyle\r\n        {\r\n            Linear,\r\n            Gravity,\r\n            InOut1,\r\n            InOut2,\r\n            Accelerate1,\r\n            Accelerate2,\r\n            Accelerate3,\r\n            Decelerate1,\r\n            Decelerate2,\r\n            Decelerate3,\r\n        }\r\n    }\r\n}\r","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/ppy/osu/blob/d9c73e12adff2feaae4a3e158d36fe5883faf6ca/osu.Game.Rulesets.Osu/Mods/OsuModApproachDifferent.cs#L69-L105","documentation":"OsuModApproachDifferent.GetEasing() maps each AnimationStyle enum value to an Easing function used for approach-circle animation. The default case throws ArgumentOutOfRangeException for any enum value not covered, ensuring an unknown style is never silently assigned a default easing.","triggerScenarios":"A new AnimationStyle enum member is added without a corresponding case in GetEasing's switch, and the mod is configured with that style.","commonSituations":"Extending the approach-different mod with a new animation style but forgetting to add the easing mapping; enum deserialization producing a value outside the known set.","solutions":["Add a case for the new AnimationStyle value returning the appropriate Easing function.","If the enum is serialized/deserialized, validate the value against the known set before use."],"exampleFix":"// before\ncase AnimationStyle.Decelerate3:\n    return Easing.OutQuint;\ndefault:\n    throw new ArgumentOutOfRangeException(nameof(style), style, @\"Unsupported animation style\");\n\n// after — add the missing case\ncase AnimationStyle.Decelerate3:\n    return Easing.OutQuint;\ncase AnimationStyle.Accelerate4:\n    return Easing.InCubic;\ndefault:\n    throw new ArgumentOutOfRangeException(nameof(style), style, @\"Unsupported animation style\");","handlingStrategy":"type-guard","validationCode":"// Validate the animation style before calling GetEasing\nif (!Enum.IsDefined(typeof(AnimationStyle), style))\n    throw new ArgumentOutOfRangeException($\"Unknown animation style: {style}\");","typeGuard":"// Type guard for AnimationStyle exhaustiveness\nstatic bool IsSupportedStyle(AnimationStyle style)\n    => Enum.IsDefined(typeof(AnimationStyle), style)\n        && style != (AnimationStyle)(-1);","tryCatchPattern":null,"preventionTips":["When adding a new AnimationStyle enum member, add the case immediately in the same commit.","Use switch expressions (C# 8+) that produce compiler warnings for non-exhaustive enums.","Add a unit test that iterates all enum values through GetEasing."],"tags":["osu-ruleset","mod","enum-exhaustiveness","animation"],"backgroundTag":null,"analyzedSha":"d9c73e12adff2feaae4a3e158d36fe5883faf6ca","analyzedAt":"2026-08-13T14:12:54.015Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}