If Scala 3.1 adopts checked exceptions, I'm looking forward to the day when I can declare a library method as, def foo: Bar throws E without worrying whether my users care about exceptions or not. Right now I must return either `Bar` or `Try[Bar]` and make _someone_ compromise.
-
-
True but the try/catch syntax is cumbersome I think especially when wrapping multiple calls. Thinking more on it, I agree that it's nice to add more typed information when interfacing with a lib (I used to write unchecked exception in Java method throws ^^).
-
But across an application I usually use a custom Error class to store more information and allow for composition or unchecked exception because I just don't care. I don't see how it could replace either, so for now I'm not sure it's much better than a custom Try with more typing
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.