Skip to content

Commit

Permalink
fix error check for bigquery
Browse files Browse the repository at this point in the history
Co-authored-by: Sten Røkke <[email protected]>
  • Loading branch information
sechmann and Muni10 committed Jan 24, 2024
1 parent 363b9c1 commit f57b829
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cmd/contests/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,14 @@ func main() {
}

if bigQueryDatasetName != "" && bigQueryProjectID != "" {
log.Info("Detected BigQuery configuration, setting up handler")

bqClient, err := bq.NewClient(ctx, bigQueryProjectID)
if err != nil {
log.Errorf("Detected BigQuery contiguration, but failed to set up client: %v", err)
} else {
log.Infof("Detected BigQuery configuration, setting up handler for %v in project %v", bigQueryDatasetName, bigQueryProjectID)
dataset := bqClient.Dataset(bigQueryDatasetName)
http.HandleFunc("/bigquery", bigquery.Handler(ctx, dataset))
} else {
log.Errorf("set up BigQuery client: %v", err)
}

} else {
log.Info("No BigQuery configuration detected, skipping handler")
}
Expand Down

0 comments on commit f57b829

Please sign in to comment.