I may work on this a little more over time, but here’s a little look at what errors, checked exceptions, and unchecked exceptions look like in Java:
I just read a short chapter in the book Effective Java, and realized I was doing something pretty dumb in my own code by always creating my own custom exceptions instead of using other exceptions already intended to be reused in the Java API.
At the time of this writing there aren’t many examples of the Scala
allCatch method to be found, so I thought I’d share some examples here.
In each example I first show the "success" case, and then show the "failure" case. Other than that, I won’t explain these, but hopefully seeing them in the REPL will be enough to get you pointed in the right direction: