{"record":{"id":"a402f2d68f483eb6","repo":"Humanizr/Humanizer","slug":"path-must-not-be-empty","errorCode":null,"errorMessage":"'{path}' must not be empty.","messagePattern":"'(.+?)' must not be empty\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs","lineNumber":1097,"sourceCode":"        static void ValidateProvenance(\n            ImmutableArray<string> provenance,\n            ImmutableDictionary<string, DurationCaseSource> sources,\n            string path)\n        {\n            foreach (var sourceId in provenance.Where(sourceId => !sources.ContainsKey(sourceId)))\n            {\n                throw new InvalidOperationException(\n                    $\"'{path}.provenance' references unknown source '{sourceId}'.\");\n            }\n        }\n\n        static string RequireScalar(SimpleYamlMapping mapping, string key, string path) =>\n            mapping.GetScalar(key)\n            ?? throw new InvalidOperationException($\"'{path}' must define scalar '{key}'.\");\n\n        static string RequireReason(string reason, string path) =>\n            string.IsNullOrWhiteSpace(reason)\n                ? throw new InvalidOperationException($\"'{path}' must not be empty.\")\n                : reason;\n\n        static ImmutableDictionary<string, DurationCaseRealization> EmptyRealizations() =>\n            ImmutableDictionary<string, DurationCaseRealization>.Empty.WithComparers(StringComparer.Ordinal);\n\n        static DurationCaseOverlay CreateBaseDurationOverlay()\n        {\n            var units = ImmutableDictionary.CreateBuilder<string, DurationCaseUnit>(StringComparer.Ordinal);\n            foreach (var unit in TimeUnits)\n            {\n                units[unit] = new DurationCaseUnit(DurationCaseUnitKind.SameAsNominative, null);\n            }\n\n            return new DurationCaseOverlay(units.ToImmutable());\n        }\n\n        static ImmutableDictionary<string, DurationCaseUnitRealization> EmptyUnitRealizations() =>\n            ImmutableDictionary<string, DurationCaseUnitRealization>.Empty.WithComparers(StringComparer.Ordinal);","sourceCodeStart":1079,"sourceCodeEnd":1115,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Common/DurationCaseModels.cs#L1079-L1115","documentation":"Thrown by RequireReason when a reason string (for notApplicable or unsupported realizations) is null, empty, or whitespace-only. The generator requires a human-readable explanation whenever a case or unit is marked as not applicable or unsupported.","triggerScenarios":"A realization uses notApplicable or unsupported with an empty string, a whitespace-only string, or (via the unsupported fallback) a null scalar value.","commonSituations":"A contributor writes 'notApplicable:' with no value, or 'notApplicable: \"\"' as a placeholder. The generator mandates a descriptive reason so future maintainers understand why the case/unit is excluded.","solutions":["Provide a concise, non-empty explanation string for the notApplicable or unsupported key at the reported path.","Rebuild to confirm the reason passes the whitespace check."],"exampleFix":"# before\ngenitive:\n  notApplicable: \"\"\n# after\ngenitive:\n  notApplicable: \"Language has no distinct genitive form for durations\"","handlingStrategy":"validation","validationCode":"# Verify notApplicable and unsupported reasons are non-empty\n# python: for case_name, real in realizations.items():\n#     for key in ('notApplicable','unsupported'):\n#         if key in real: assert real[key] and real[key].strip(), f'empty {key} reason'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always provide a descriptive reason string for notApplicable and unsupported entries.","Never leave a reason value blank or whitespace-only.","Use a known-good locale file as a template for reason wording."],"tags":["humanizer","locale","yaml","source-generator","duration-cases","reason","build-time"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}