Skip to content

Improve error handling for non-existent query jobs in get_status #1975

@coderabbitai

Description

@coderabbitai

Problem

Currently, when attempting to retrieve results or status for a non-existent query job, the API returns success instead of an error. This behavior is inconsistent with proper error handling practices.

Proposed Solution

Update the get_status method to return SearchJobNotFound error when the job does not exist. This should be done by adding a SQL query to check whether the job exists before attempting to retrieve its status.

Context

This issue was identified during the review of PR #1964, which added a cancel_search_job endpoint with proper SearchJobNotFound error handling. The same improvement should be applied to get_status and potentially other query job-related methods.

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions