on master help sign in
Use `prettyPrintParseException` in `decodeEither`.
730dda7Francesco Mazzoli
Data/Yaml.hs+1−1
@@ -167,7 +167,7 @@ decodeFileEither = decodeHelper_ . Y.decodeFile
167
167
168decodeEither :: FromJSON a => ByteString -> Either String a
168decodeEither :: FromJSON a => ByteString -> Either String a
169decodeEither bs = unsafePerformIO
169decodeEither bs = unsafePerformIO
170− $ fmap (either (Left . show) id)
170+ $ fmap (either (Left . prettyPrintParseException) id)
171 $ decodeHelper (Y.decode bs)
171 $ decodeHelper (Y.decode bs)
172
172
173-- | More helpful version of 'decodeEither' which returns the 'YamlException'.
173-- | More helpful version of 'decodeEither' which returns the 'YamlException'.