Repository: TabbyML/tabby
File: ee/tabby-webserver/src/service/repository/third_party.rs (Rust)

Code before:
        }

        Ok(())
    }

    async fn sync_repositories(&self, integration_id: ID) -> Result<()> {
        let provider = self.integration.get_integration(integration_id).await?;
        debug!(
            "Refreshing repositories for provider: {}",
            provider.display_name
        );

        let repos = match fetch_all_repos(
            provider.kind.clone(),
            &provider.access_token,
            provider.api_base(),
        )
        .await
        {
            Ok(repos) => repos,
            Err(err) => {
                self.integration
                    .update_integration_sync_status(&provider.id, Some(err.to_string()))
                    .await?;
                bail!(
                    "Failed to fetch repositories from integration: {}, error: {}",
                    provider.display_name,
                    err
                );
            }
        };

        refresh_repositories_for_provider(self, &*self.integration, provider, repos).await?;
        Ok(())
    }

    async fn upsert_repository(
        &self,
        integration_id: ID,
        vendor_id: String,
        display_name: String,
        git_url: String,
    ) -> Result<ID> {
        let id = self
            .db
            .upsert_provided_repository(
                integration_id.as_rowid()?,
                vendor_id,
                display_name,
                git_url,
            )

Review comment (bug):
```suggestion
                    "Failed to retrieve repositories from the specified integration: {}. An error occurred: {}. Please verify your context provider settings to resolve the issue.",
```

Code after:
        }

        Ok(())
    }

    async fn sync_repositories(&self, integration_id: ID) -> Result<()> {
        let provider = self.integration.get_integration(integration_id).await?;
        debug!(
            "Refreshing repositories for provider: {}",
            provider.display_name
        );

        let repos = match fetch_all_repos(
            provider.kind.clone(),
            &provider.access_token,
            provider.api_base(),
        )
        .await
        {
            Ok(repos) => repos,
            Err(err) => {
                self.integration
                    .update_integration_sync_status(&provider.id, Some(err.to_string()))
                    .await?;
                bail!(
                    "Failed to retrieve repositories from the specified integration: {}. An error occurred: {}. Please verify your context provider settings to resolve the issue.",
                    provider.display_name,
                    err
                );
            }
        };

        refresh_repositories_for_provider(self, &*self.integration, provider, repos).await?;
        Ok(())
    }

    async fn upsert_repository(
        &self,
        integration_id: ID,
        vendor_id: String,
        display_name: String,
        git_url: String,
    ) -> Result<ID> {
        let id = self
            .db
            .upsert_provided_repository(
                integration_id.as_rowid()?,
                vendor_id,
                display_name,
                git_url,
            )