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

> You can't write a method that takes an instance of Foo and says "my method throws whatever Foo.bar() throws" or even "my method throws iff Foo.bar() throws".

If you could it'd mean altering the implementation would automatically alter the API, which would be rather unexpected.

That's why the Java approach is to wrap exceptions and propagate causal chains. The underlying errors thrown by the implementation can change but the advertised exceptions don't, but no information is lost.



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

Search: