This is a little bit of a boilerplate construct, a more common Java style is to replace the "if else" in the calling code with the "try catch".