|
|
@@ -2,6 +2,7 @@ package gcp
|
|
|
|
|
|
import (
|
|
|
"context"
|
|
|
+ "fmt"
|
|
|
|
|
|
"cloud.google.com/go/bigquery"
|
|
|
"github.com/opencost/opencost/pkg/cloud"
|
|
|
@@ -49,9 +50,12 @@ func (bqq *BigQueryQuerier) Query(ctx context.Context, queryStr string) (*bigque
|
|
|
// If result is empty and connection status is not already successful update status to missing data
|
|
|
if iter == nil && bqq.ConnectionStatus != cloud.SuccessfulConnection {
|
|
|
bqq.ConnectionStatus = cloud.MissingData
|
|
|
- return iter, nil
|
|
|
+ } else {
|
|
|
+ bqq.ConnectionStatus = cloud.SuccessfulConnection
|
|
|
}
|
|
|
|
|
|
- bqq.ConnectionStatus = cloud.SuccessfulConnection
|
|
|
+ if err != nil {
|
|
|
+ return iter, fmt.Errorf("BigQueryQuerier: Query: error reading query results: %w", err)
|
|
|
+ }
|
|
|
return iter, nil
|
|
|
}
|