Commits

Bryan O'Sullivan  committed 93b496b

Improve parseJSON failure message for Either

This fixes #193.

  • Participants
  • Parent commits 66d7a50
  • Tags 0.7.0.3

Comments (0)

Files changed (1)

File Data/Aeson/Types/Instances.hs

     parseJSON (Object (H.toList -> [(key, value)]))
         | key == left  = Left  <$> parseJSON value
         | key == right = Right <$> parseJSON value
-    parseJSON _        = fail ""
+    parseJSON _        = fail $
+        "expected an object with a single property " ++
+        "where the property key should be either " ++
+        "\"Left\" or \"Right\""
     {-# INLINE parseJSON #-}
 
 left, right :: Text