Log the exception in case of error