Skip to content

Commit

Permalink
Better error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Geens committed Jan 13, 2025
1 parent ad9587a commit af4e08d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion share/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ func (m *mgr) getPath(ctx context.Context, resID *provider.ResourceId) (string,
return "", err
}

return res.GetPath(), nil
if res.Status.Code == rpc.Code_CODE_OK {
return res.GetPath(), nil
} else if res.Status.Code == rpc.Code_CODE_NOT_FOUND {
return "", errtypes.NotFound(resID.OpaqueId)
}
return "", errors.New(res.Status.Code.String() + ": " + res.Status.Message)
}

func (m *mgr) isProjectAdmin(u *userpb.User, path string) bool {
Expand Down

0 comments on commit af4e08d

Please sign in to comment.