Checking for exceptions in the try block