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

This is the default behavior of the new check system. If you don't handle it at the bottom of the stack it is propagated up the stack to the caller automatically. Not sure how easy this will be to debug since it doesn't capture a stack trace at the bottom and it won't be obvious where the error started.


But isn’t it only to the immediate caller using the explicitly declared error, not all the way up the stack?

That’s very different behaviour and along with using the error interface avoids the main objections to exceptions ( unexpected throws handled far from the error location, unexpected errr types).

This is just a small change to make it easier to annotate and easier to return without comment.


Assuming the caller uses check as well it will continue on. Seems the same as checked exceptions to me.


That’s an invalid assumption, as most functions will not use check (looking at my code there are just a few places I’d use it). It’s an addition to current error handling, not a replacement.




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

Search: