Add more details in error message for invalid vote option (#9185)

Co-authored-by: Marko <marbar3778@yahoo.com>
Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com>
This commit is contained in:
Devashish Dixit
2021-04-28 10:19:08 +00:00
committed by GitHub
co-authored by Marko Amaury
parent e8e5c08655
commit 15edf3c38f
+1 -1
View File
@@ -89,7 +89,7 @@ func ValidWeightedVoteOption(option WeightedVoteOption) bool {
func VoteOptionFromString(str string) (VoteOption, error) {
option, ok := VoteOption_value[str]
if !ok {
return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option", str)
return OptionEmpty, fmt.Errorf("'%s' is not a valid vote option, available options: yes/no/no_with_veto/abstain", str)
}
return VoteOption(option), nil
}