Modify Parser error value #104

Closed
snoyberg opened this Issue Dec 26, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

snoyberg commented Dec 26, 2012

Motivated by yesodweb/persistent#60.

It would be nice to be able to provide more information for an error message. For example:

parseJSON (Object o) = modifyFailure
    (\s -> "Parsing of the Persistent config file failed: " ++ s)
    (Foo <$> o .: "someField")

Currently, I could do something like <|> fail "Parsing of Persistent config file failed", but I can't get access to the original error message.

@snoyberg snoyberg referenced this issue in yesodweb/persistent Dec 26, 2012

Closed

Error handling in configuration #60

Owner

bos commented Dec 31, 2012

Sure, that looks handy. Want to submit a patch?

snoyberg added a commit to snoyberg/aeson that referenced this issue Jan 1, 2013

@snoyberg snoyberg referenced this issue Jan 1, 2013

Merged

modifyFailure #106

Contributor

snoyberg commented Jan 1, 2013

Pull request #106 sent.

Owner

bos commented Jan 2, 2013

Aaand fixed.

@bos bos closed this Jan 2, 2013

Contributor

snoyberg commented Apr 11, 2013

Would it be possible to release a new version of aeson with this change?

tolysz pushed a commit to tolysz/aeson that referenced this issue May 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment