Skip to content

Conversation

@mts1715
Copy link

@mts1715 mts1715 commented Oct 17, 2025

Closes #7649
Updated error handling for GetCollectionByID to use access api error framework.
Fixed godocs.

GetCollectionByID
GetFullCollectionByID
to use access api error framework
@mts1715 mts1715 requested a review from a team as a code owner October 17, 2025 15:07
@peterargue peterargue changed the base branch from master to feature/optimistic-sync October 17, 2025 15:31
// TODO: transactions is not updated to use the new error handling convention
// Update this once that work is complete
return nil, err
return nil, common.ErrorToStatusError(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as noted in the comment, this endpoint isn't updated to use the new error messages, so we can't switch the error handling in this case yet.

err = response.Build(collection, transactions, link, r.ExpandFields)
if err != nil {
return nil, err
return nil, common.ErrorToStatusError(err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

common.ErrorToStatusError() converts an accessSentinel error to a REST error. I don't think response.Build() calls into the backend code, so the returned error is not an accessSentinel. double check if the error returned is already wrapped. if not, you can use a specific status code error here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DataAvailability] Improve Collection Endpoints error handling and documentation.

2 participants