Repository navigation
Add a distinct exception for generative query failures - #2210
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
|
I agree to the Weaviate Contributor License Agreement. The Main CI workflow is awaiting maintainer approval. Could a maintainer approve the workflow and review this PR? The local Linux unit/mock suite passed with 646 tests passing and 1 skipped, and the before/after behavior was verified against Weaviate 1.39.7 for both sync and async clients. |
|
@dirkkul, could you review this generative-query exception change or route it to the appropriate reviewer? The CLA acknowledgment and local validation are documented above. Please also confirm whether any fork CI approval or additional checks are needed before merge. |
|
@dirkkul, could you review the generative-query exception contract or route it to the Python client reviewer? The new exception remains a subclass of WeaviateQueryError, preserving existing handlers. The CLA acknowledgment, 646-test Linux run, and real-server before/after checks are documented above. Could you also confirm whether the Main workflow still needs fork approval and what remains before merge? |
|
Hi @dirkkul and @tsmith023, I’ve addressed the three review comments in The four mock cases pass, and both integration tests pass against Weaviate 1.39.7. Lint and formatting checks pass too. Could you approve the pending CI workflow and take another look? If everything looks good and the required checks pass, I’d appreciate your approval and a merge. I’m happy to make any final adjustments. Thanks! |
Generative-query failures currently raise the same
WeaviateQueryErroras ordinary searches, so applications cannot select RAG-specific troubleshooting by exception type.Add
WeaviateGenerativeQueryErroras a subclass ofWeaviateQueryError. Sync and async gRPC searches select it when the request contains the generative field, including deadline expiry and exhausted retries. A shared_search_errorhelper selects the exception in both clients. Permission errors are handled before that selection.Compatibility: existing
except WeaviateQueryErrorhandlers andisinstance(e, WeaviateQueryError)checks still match. Exact checks such astype(e) is WeaviateQueryErrorno longer match failed generative requests; useisinstancewhen subclasses should match. The existingGRPC searcherror wording is preserved. Themessageanderrorattributes retain the original details, and exception chaining preserves the cause. Ordinary searches retain the generic exception.The exception identifies a failed generative request; retrieval can also fail, so it does not assume the provider caused the failure. The exception documentation includes a catch-order example and troubleshooting guidance.
Closes #818.
Validation of the current commit (
a22d4f3):generative-dummy,generative-anyscaleenabled and no provider API key. They check the specialized generative exception, compatibility with the base exception and existing error wording, and the exact generic exception for ordinary queries.git diff --checkpasses.Before the review follow-up, the full Linux unit/mock suite passed with 646 tests passing and 1 skipped. That earlier run covered the previous commit, not the revised test suite.