use logger.error when logging errors from handle_errors