News for hackers. Stuff that matters.
Re:JEP draft: Exception handling in switch by ackfoobar on Friday April 19, 2024 @05:16PM (#40091997)
> by the time you've included Anyhow with stack traces enabled you've basically reinvented checked exceptions in Result types

If the error is wrapped into an `anyhow::Error`, and the result in `anyhow::Result<T>`, it has less information than checked exceptions. Coz the type now only tells you the call can fail, but not how (it's anyhow!).

> That's the part that you seem to be missing: checked exceptions are nearly identical semantically to result types

That's the crux.

There are no comments on this comment yet.