{"record":{"id":"b80aa4301f7387f5","repo":"Humanizr/Humanizer","slug":"unknown-clock-notation-profile","errorCode":null,"errorMessage":"Unknown clock-notation profile.","messagePattern":"Unknown clock-notation profile\\.","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/TimeOnlyToClockNotationProfileCatalogInput.cs","lineNumber":77,"sourceCode":"            builder.AppendLine(\"namespace Humanizer;\");\n            builder.AppendLine();\n            builder.AppendLine(\"static partial class TimeOnlyToClockNotationProfileCatalog\");\n            builder.AppendLine(\"{\");\n            builder.AppendLine(\"    public static ITimeOnlyToClockNotationConverter Resolve(string kind, CultureInfo culture)\");\n            builder.AppendLine(\"    {\");\n            builder.AppendLine(\"        switch (kind)\");\n            builder.AppendLine(\"        {\");\n\n            foreach (var profile in profiles.OrderBy(static profile => profile.ProfileName, StringComparer.Ordinal))\n            {\n                builder.Append(\"            case \");\n                builder.Append(QuoteLiteral(profile.ProfileName));\n                builder.Append(\": return \");\n                builder.Append(GetCatalogPropertyName(profile.ProfileName));\n                builder.AppendLine(\".WithCulture(culture);\");\n            }\n\n            builder.AppendLine(\"            default: throw new ArgumentOutOfRangeException(nameof(kind), kind, \\\"Unknown clock-notation profile.\\\");\");\n            builder.AppendLine(\"        }\");\n            builder.AppendLine(\"    }\");\n            builder.AppendLine();\n\n            foreach (var profile in profiles.OrderBy(static profile => profile.ProfileName, StringComparer.Ordinal))\n            {\n                AppendLazyCachedMember(\n                    builder,\n                    \"    \",\n                    \"static\",\n                    \"PhraseClockNotationConverter\",\n                    GetCatalogPropertyName(profile.ProfileName),\n                    TimeOnlyToClockNotationEngineContractFactory.Create(profile, contracts));\n                builder.AppendLine();\n            }\n\n            builder.AppendLine(\"}\");\n            builder.AppendLine();","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/TimeOnlyToClockNotationProfileCatalogInput.cs#L59-L95","documentation":"This message is emitted into generated source code (TimeOnlyToClockNotationProfileCatalog.g.cs, gated by NET6_0_OR_GREATER) as the default case of the Resolve switch. At runtime, TimeOnlyToClockNotationProfileCatalog.Resolve(kind, culture) throws ArgumentOutOfRangeException when the kind string does not match any compiled clock-notation profile name. Only locales whose clock-notation feature was registered as generated appear in the switch.","triggerScenarios":"Calling a clock-notation API (e.g. timeOnly.ToClockNotation()) with a culture whose clock-notation profile name is not compiled into the catalog. The feature may be missing for that locale or the profile name may not match.","commonSituations":"A consumer targets .NET 6+ and requests clock notation for an unsupported locale. This error is also gated to .NET 6+ — calling on older frameworks would not even compile the catalog.","solutions":["Verify the target locale has a timeOnlyToClockNotation YAML block with a matching profile name.","Ensure the clock-notation feature is registered with UsesGeneratedProfile: true in the locale YAML.","Fall back to a known-supported locale (e.g. 'en') if the requested locale is unsupported.","Confirm the project targets .NET 6.0 or later, since the catalog is compiled only under NET6_0_OR_GREATER."],"exampleFix":"// before — 'xx' has no clock-notation profile\nvar clock = timeOnly.ToClockNotation(new CultureInfo(\"xx\"));\n\n// after — use a supported locale\nvar clock = timeOnly.ToClockNotation(new CultureInfo(\"en\"));","handlingStrategy":"validation","validationCode":"// Before calling a clock-notation API with an arbitrary locale, verify support.\n// Note: the catalog is compiled only under NET6_0_OR_GREATER.\nvar culture = new CultureInfo(\"en\");","typeGuard":null,"tryCatchPattern":"try\n{\n    var converter = TimeOnlyToClockNotationProfileCatalog.Resolve(kind, culture);\n}\ncatch (ArgumentOutOfRangeException)\n{\n    converter = TimeOnlyToClockNotationProfileCatalog.Resolve(\"en\", culture);\n}","preventionTips":["Ensure the project targets .NET 6.0 or later — the clock-notation catalog is gated by NET6_0_OR_GREATER.","Verify the target locale is shipped with a timeOnlyToClockNotation block.","Use public APIs which fall back gracefully for unsupported locales."],"tags":["runtime","clock-notation","generated-code","locale","argument-out-of-range","net6-plus"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}