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 (kubeflow#11098)

Signed-off-by: hbelmiro <[email protected]>
  • Loading branch information
hbelmiro authored and sefgsefg committed Sep 20, 2024
1 parent 8fbe07c commit 5deb245
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 5deb245

Please sign in to comment.