diff --git a/nexus/peer-bigquery/src/lib.rs b/nexus/peer-bigquery/src/lib.rs index e0f9fa99f3..880219661c 100644 --- a/nexus/peer-bigquery/src/lib.rs +++ b/nexus/peer-bigquery/src/lib.rs @@ -82,18 +82,17 @@ impl BigQueryQueryExecutor { .client .job() .query(&self.project_id, query_req) - .await - .map_err(|err| { - tracing::error!("error running query: {}", err); - PgWireError::ApiError(err.into()) - })?; + .await; token.end().await.map_err(|err| { tracing::error!("error closing tracking token: {}", err); PgWireError::ApiError(err.into()) })?; - Ok(result_set) + result_set.map_err(|err| { + tracing::error!("error running query: {}", err); + PgWireError::ApiError(err.into()) + }) } }