Skip to content

Commit

Permalink
chore: Wrapped "Failed GetContextByTypeAndName" error for better trou…
Browse files Browse the repository at this point in the history
…bleshooting (#11098)

Signed-off-by: hbelmiro <[email protected]>
  • Loading branch information
hbelmiro authored Aug 28, 2024
1 parent e1d172b commit 7c7ff12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/src/v2/metadata/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/kubeflow/pipelines/backend/src/common/util"
"github.com/kubeflow/pipelines/backend/src/v2/objectstore"
"path"
"strconv"
Expand Down Expand Up @@ -1073,7 +1074,7 @@ func (c *Client) getOrInsertContext(ctx context.Context, name string, contextTyp
getCtxRes, err := c.svc.GetContextByTypeAndName(ctx, &pb.GetContextByTypeAndNameRequest{TypeName: contextType.Name, ContextName: proto.String(name)})

if err != nil {
return nil, fmt.Errorf("Failed GetContextByTypeAndName(type=%q, name=%q)", contextType.GetName(), name)
return nil, util.Wrap(err, fmt.Sprintf("Failed GetContextByTypeAndName(type=%q, name=%q)", contextType.GetName(), name))
}
// Bug in MLMD GetContextsByTypeAndName? It doesn't return error even when no
// context was found.
Expand Down

0 comments on commit 7c7ff12

Please sign in to comment.