Improve enum error message
commit9d6263b6f31276c9b6528ecf9d043fdc39c42443
authorMark Eibes <mark.eibes@gmail.com>
dateThu 1 Sep 2022, 13:12 (4 years ago)
parent7f03c17
src/Yoga/JSON/Generics/EnumSumRep.purs+1−1
@@ -58,7 +58,7 @@ instance
5858 s ← JSON.readImpl f
5959 if s == options.toConstructorName name then pure $ GR.Constructor GR.NoArguments
6060 else fail <<< Foreign.ForeignError $
61− "Enum string " <> s <> " did not match expected string " <> name
61+ "Enum string " <> s <> " did not match expected string " <> options.toConstructorName name
6262 where
6363 name = reflectSymbol (Proxy ∷ Proxy name)
6464 genericEnumWriteForeign options (GR.Constructor GR.NoArguments) =