From d2833341ff247ef143607f84d957951f5dd5d71a Mon Sep 17 00:00:00 2001 From: Dylan Moreland Date: Thu, 10 Oct 2024 16:00:05 -0400 Subject: [PATCH] Better error here when Elastic query fails --- internal/controllers/rewards.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/controllers/rewards.go b/internal/controllers/rewards.go index f4f2b6f..1d0a083 100644 --- a/internal/controllers/rewards.go +++ b/internal/controllers/rewards.go @@ -115,7 +115,7 @@ func (r *RewardsController) GetUserRewards(c *fiber.Ctx) error { integQueryStart := time.Now() resp, err := r.DataClient.GetIntegrationsMultiple(c.Context(), userDeviceIDs, weekStart, now) if err != nil { - return err + return fmt.Errorf("failed to grab integration activity data for user vehicles: %w", err) } if integQueryDur := time.Since(integQueryStart); integQueryDur >= 5*time.Second { logger.Info().Msgf("Long integrations query: took %s for %d vehicles.", integQueryDur, len(devices.UserDevices))