News for hackers. Stuff that matters.
Re:Go 1.3 is released by eropple on Friday June 20, 2014 @04:25PM (#7922694)
> So you call say 3 methods, and at the end you have a "file not found" error... which call resulted in that failure?

The first exception hit pops out the other side and you pattern-match against it. So, the one that did file access and returned a FileNotFoundException. If you have multiple pieces of code that can return FileNotFoundExceptions, you can pass a message in the exception, just like any other Java exception. You can often be more type-specific, too. Bear in mind that defining a new exception in Scala is a one-liner, and you can encapsulate your FileNotFoundException in a RetrievalFailedException very easily and cleanly.

Your method is not more robust, I assure you--it's just verbose and both typo- and thinko-prone.

There are no comments on this comment yet.