Skip to content

PYCO-98: Update Error Handling#15

Merged
thejcfactor merged 2 commits into
mainfrom
PYCO-98
May 19, 2026
Merged

PYCO-98: Update Error Handling#15
thejcfactor merged 2 commits into
mainfrom
PYCO-98

Conversation

@thejcfactor

Copy link
Copy Markdown
Collaborator

Changes

  • Raise AnalyticsError if SDK receives HTTP 500 status code
  • Raise AnalyticsError if start_query() response is missing requestID or handle

Changes
-------
* Raise `AnalyticsError` if SDK receives HTTP 500 status code
* Raise `AnalyticsError` if `start_query()` response is missing
  `requestID` or `handle`

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates protocol-level error handling to ensure the client surfaces consistent AnalyticsError exceptions for certain server-side failures and malformed start_query() responses.

Changes:

  • Map HTTP 500 responses to AnalyticsError via ErrorMapper.maybe_get_error_from_status_code.
  • Raise AnalyticsError (instead of QueryNotFoundError) when start_query() responses are missing requestID and/or handle.
  • Apply the missing-field handling consistently across both blocking and async query-handle implementations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
couchbase_analytics/protocol/query_handle.py Consolidates missing requestID/handle checks and raises AnalyticsError with a combined missing-fields message.
couchbase_analytics/protocol/errors.py Adds HTTP 500 handling to raise AnalyticsError from status-code checks.
acouchbase_analytics/protocol/query_handle.py Mirrors the blocking implementation’s missing-field handling for async query handles.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread couchbase_analytics/protocol/errors.py Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@thejcfactor thejcfactor merged commit 234c07c into main May 19, 2026
43 checks passed
@thejcfactor thejcfactor deleted the PYCO-98 branch May 19, 2026 18:51
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.

3 participants