Checking for exception