Convert to java

catch Exceptions and Errors separately