def _handle_validation_error(self, error, auth_config_class, base_error_message):
        """Handle validation errors for auth fields."""
        from pydantic import ValidationError

        if isinstance(error, ValidationError):
            # Extract the field names and error messages
            error_messages = []
            for err in error.errors():
                field = ".".join(str(loc) for loc in err.get("loc", []))
                msg = err.get("msg", "")
                error_messages.append(f"Field '{field}': {msg}")

            error_detail = f"Invalid configuration for {auth_config_class}:\n" + "\n".join(
                error_messages
            )
            raise HTTPException(
                status_code=422,
                detail=f"Invalid auth fields: {error_detail}. " + base_error_message,
            ) from error
        else:
            # For other types of errors
            raise HTTPException(
                status_code=422,
                detail=f"Invalid auth fields: {str(error)}. " + base_error_message,
            ) from error
Handle validation errors for auth fields.
backend/airweave/core/connection_service.py