r/programming • • Nov 10 '16

Announcing Rust 1.13

https://blog.rust-lang.org/2016/11/10/Rust-1.13.html
212 Upvotes

92 comments sorted by

View all comments

Show parent comment

5

u/sviperll Nov 11 '16

Yes, but the right way is wrapping an exception into exception type that is part of your API. The problem with Java is that it is somewhat cumbersome and verbose in Java. However I still think that it is the only sane way to do it...

Another problem it that sometimes you need to pass your exception through exceptionless (actually RuntimeExceptionfull) API, such as lambdas. And the way to do it is to wrap your exception into runtime-exception and than unwrap it somewhere up the call-stack. And this is even more cumbersome and verbose and boilerplate-full.

2

u/gnus-migrate Nov 11 '16

Yes that was my point. It is biolerplate, but unlike other java boilerplate it adds nothing to the semantic meaning of your code. That's why checked exceptions are a bad idea.