Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> in my opinion they all do the wrong thing

What would be the right thing? Combining the original exception and the error from `close` into some kind of `MultipleError`?



That's probably the best option I think. I've heard Ada does that (but don't quote me on that). If you can access the original errors from the `MultipleError` object, at least you can tell the user what exactly went wrong.

I don't thing there's one true right thing™ though. That's why explicit handling is necessary: The compiler doesn't have enough context to handle it for you. The programmer needs to decide what's the right way to handle it.


Personally I do not believe the math of these two monads allows for any better solutions (and I do not believe multierror is correct ;P)... I am thereby also very curious what they think the correct thing to do here is.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: