mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-06 14:16:51 +08:00
Returning a 404 if no metrics are found.
This commit is contained in:
@@ -2,6 +2,8 @@ package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/onepanelio/core/pkg/util"
|
||||
"google.golang.org/grpc/codes"
|
||||
"math"
|
||||
"sort"
|
||||
"strings"
|
||||
@@ -189,6 +191,9 @@ func (s *WorkflowServer) GetWorkflowExecutionMetrics(ctx context.Context, req *a
|
||||
Format: m.Format,
|
||||
})
|
||||
}
|
||||
if len(apiMetrics) == 0 {
|
||||
return nil, util.NewUserError(codes.NotFound, "Metrics were not found.")
|
||||
}
|
||||
|
||||
return &api.GetWorkflowExecutionMetricsResponse{Metrics: apiMetrics}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user