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 58d68e6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions share/sql/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,13 @@ func (m *mgr) getPath(ctx context.Context, resID *provider.ResourceId) (string,
return "", err
}

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)

return res.GetPath(), nil
}

Expand Down

0 comments on commit 58d68e6

Please sign in to comment.