Skip to content

Commit

Permalink
Improve error message for invalid enums with only one case
Browse files Browse the repository at this point in the history
  • Loading branch information
Christer van der Meeren committed Dec 21, 2023
1 parent e30bd11 commit 509c0f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Felicity/Errors.fs
Expand Up @@ -323,7 +323,7 @@ let invalidParsedErrMsg (info: ParsedValueInfo) errMsg =
let invalidEnum (info: ParsedValueInfo) allowedValues =
let expectedStr =
match allowedValues with
| [ x ] -> x
| [ x ] -> $"'%s{x}'"
| xs -> "one of " + (xs |> List.map (sprintf "'%s'") |> String.concat ", ")

match info with
Expand Down

0 comments on commit 509c0f5

Please sign in to comment.