{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidt4hsuvxorhh5hg3h5xngj7v6ln6sgmu4o6odtkmngugino4wirm",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mlpx646fqrv2"
},
"path": "/t/exception-annotations-lay-of-the-land/14056#post_4",
"publishedAt": "2026-05-13T07:58:14.000Z",
"site": "https://discourse.haskell.org",
"textContent": "I don’t know what the original motivation was for clearing the context of `SomeException`; if someone does, please do let me know, I’d love to know. Now that we are here though, I hesitate to argue that we should stop doing that; there are a lot of puzzle pieces here that need to fit together _just_ so, and it’s difficult to be sure what happens when we change something quite so central as `SomeException` itself. Your `toExceptionPreservingContext` proposal at least separates out these concerns; if we conclude that the behaviour of `toException` for `SomeException` _is_ the right one, then perhaps something like that might be useful. It would still be quite confusing though that `throwIO (ExceptionWithContext ctxt e)` would not actually use that context `ctxt` though! Personally I think we _should_ change the behaviour and simply drop the requirement that the context must be empty, but it’s hard to be sure.\n\nAs for your question about the two backtraces: yes, you are correct. That’s why we have `catchNoPropagate` and `rethrowIO`.",
"title": "Exception Annotations: Lay of the Land"
}