Add check for exception message