Skip to content

throwDecode doesn't have HasCallStack #1187

Description

@phadej

though throwM does.

So the backtraces collected by exceptions end somewhere inside aeson library, not including the call-site of throwDecode:

*Data.Aeson> :m +Control.Exception
*Data.Aeson Control.Exception> :set -XOverloadedStrings 
*Data.Aeson Control.Exception> throwIO (AesonException "wrong")
*** Exception: aeson: wrong

HasCallStack backtrace:
  throwIO, called at <interactive>:3:1 in interactive:Ghci1

*Data.Aeson Control.Exception> throwDecode "nll" :: IO Int
*** Exception: aeson: Unexpected "nll", expecting JSON value

HasCallStack backtrace:
  throwIO, called at libraries/exceptions/src/Control/Monad/Catch.hs:343:12 in exceptions-0.10.11-97e4:Control.Monad.Catch
  throwM, called at src/Data/Aeson/Decoding.hs:89:61 in aeson-2.3.1.0-inplace:Data.Aeson.Decoding

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions