From ede08c06f81f1356c9252851bd53623678799c37 Mon Sep 17 00:00:00 2001 From: "taekyu.kang" Date: Thu, 23 May 2024 16:31:25 +0900 Subject: [PATCH] trivial. fix error code for thanosclient --- internal/usecase/dashboard.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/usecase/dashboard.go b/internal/usecase/dashboard.go index 2dae8e63..4877ea5d 100644 --- a/internal/usecase/dashboard.go +++ b/internal/usecase/dashboard.go @@ -815,7 +815,7 @@ func (u *DashboardUsecase) GetPolicyEnforcement(ctx context.Context, organizatio func (u *DashboardUsecase) GetPolicyViolation(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error) { thanosClient, err := u.GetThanosClient(ctx, organizationId) if err != nil { - return nil, errors.Wrap(err, "failed to create thanos client") + return nil, httpErrors.NewInternalServerError(err, "D_INVALID_PRIMARY_STACK", "") } durationSec, intervalSec := getDurationAndIntervalSec(duration, interval) @@ -950,7 +950,7 @@ func (u *DashboardUsecase) GetPolicyViolationLog(ctx context.Context, organizati func (u *DashboardUsecase) GetWorkload(ctx context.Context, organizationId string) (*domain.GetDashboardWorkloadResponse, error) { thanosClient, err := u.GetThanosClient(ctx, organizationId) if err != nil { - return nil, errors.Wrap(err, "failed to create thanos client") + return nil, httpErrors.NewInternalServerError(err, "D_INVALID_PRIMARY_STACK", "") } clusterIdStr, err := u.GetFlatClusterIds(ctx, organizationId) @@ -1027,7 +1027,7 @@ func (u *DashboardUsecase) GetWorkload(ctx context.Context, organizationId strin func (u *DashboardUsecase) GetPolicyViolationTop5(ctx context.Context, organizationId string, duration string, interval string) (*domain.BarChartData, error) { thanosClient, err := u.GetThanosClient(ctx, organizationId) if err != nil { - return nil, errors.Wrap(err, "failed to create thanos client") + return nil, httpErrors.NewInternalServerError(err, "D_INVALID_PRIMARY_STACK", "") } durationSec, intervalSec := getDurationAndIntervalSec(duration, interval)