I found that it\'s a shame that I can\'t return a return value from a such simple construction as try ... catch ... finally
def foo: String = {
This method returns a Unit
; you have to return something in the catch block; or I'd rather suggest to change the return type to e.g. Option
; or use Try
class.
What is obvious - you don't always have a string in this situation. In Java people tend to ignore the realities, but this is Scala, one can do better.