ING-1311: Return defined errors when appropriate - #377
Conversation
There was a problem hiding this comment.
Pull request overview
This PR standardizes client-side argument validation by returning defined/structured errors instead of ad-hoc errors.New(...) strings, improving programmatic error handling across Search, Query, and Management helpers.
Changes:
cbsearchx: replaces string errors with defined sentinel errors for scoped/bucket validation and index creation validations.cbqueryx/cbmgmtx: replaces string errors withServerInvalidArgError-based errors for invalid options passed to management/query operations.- Adds new defined errors in
cbsearchx/errors.gofor empty index/source type validations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| cbsearchx/search.go | Returns defined errors for invalid scope/bucket combos and missing index fields during upsert. |
| cbsearchx/errors.go | Introduces new sentinel errors for empty index type/source type. |
| cbqueryx/query.go | Switches index create/drop option validation to structured invalid-argument errors. |
| cbmgmtx/mgmt.go | Switches various management option validations to structured invalid-argument errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
83afff6 to
360dabd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
360dabd to
9769761
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9769761 to
248de21
Compare
No description provided.