Skip to content

ING-1311: Return defined errors when appropriate - #377

Open
Westwooo wants to merge 2 commits into
masterfrom
ING-1311-undefined-errors
Open

ING-1311: Return defined errors when appropriate#377
Westwooo wants to merge 2 commits into
masterfrom
ING-1311-undefined-errors

Conversation

@Westwooo

@Westwooo Westwooo commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 with ServerInvalidArgError-based errors for invalid options passed to management/query operations.
  • Adds new defined errors in cbsearchx/errors.go for 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.

Comment thread cbqueryx/query.go Outdated
Comment thread cbmgmtx/mgmt.go Outdated
Comment thread cbsearchx/search.go
Comment thread cbsearchx/search.go
@Westwooo
Westwooo force-pushed the ING-1311-undefined-errors branch 2 times, most recently from 83afff6 to 360dabd Compare April 2, 2026 10:40
@Westwooo
Westwooo requested a review from Copilot April 2, 2026 11:09

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread cbsearchx/search.go
Comment thread .github/workflows/unit-benchmark.yml
Comment thread cbsearchx/search.go
Comment thread cbqueryx/query.go
Comment thread cbmgmtx/mgmt.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@Westwooo
Westwooo force-pushed the ING-1311-undefined-errors branch from 9769761 to 248de21 Compare April 10, 2026 14:22
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.

2 participants