mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-10-05 05:36:50 +08:00
Adding error check.
This commit is contained in:
@@ -975,6 +975,15 @@ func (c *Client) GetWorkflowExecutionMetrics(namespace, uid, podName string) (me
|
||||
}
|
||||
key := config.ArtifactRepository.GCS.FormatKey(namespace, uid, podName) + "/sys-metrics.json"
|
||||
stream, err = gcsClient.Bucket(config.ArtifactRepository.GCS.Bucket).Object(key).NewReader(ctx)
|
||||
if err != nil {
|
||||
log.WithFields(log.Fields{
|
||||
"Namespace": namespace,
|
||||
"UID": uid,
|
||||
"PodName": podName,
|
||||
"Error": err.Error(),
|
||||
}).Error("Metrics do not exist.")
|
||||
return nil, util.NewUserError(codes.NotFound, "Metrics do not exist.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user