Skip to content

Add optional exception for failed tasks in wait_for_task - #1279

Draft
chenyujia1024 wants to merge 1 commit into
meilisearch:mainfrom
chenyujia1024:fix/task-failure-wait
Draft

Add optional exception for failed tasks in wait_for_task#1279
chenyujia1024 wants to merge 1 commit into
meilisearch:mainfrom
chenyujia1024:fix/task-failure-wait

Conversation

@chenyujia1024

Copy link
Copy Markdown

Related issue

Related to #747

What does this PR do?

Adds an opt-in raise_on_failure option to wait_for_task.

  • Existing behavior remains unchanged by default.
  • When raise_on_failure=True, a task with status failed raises MeilisearchTaskFailedError.
  • Successful, canceled, and other terminal tasks continue to return Task.
  • Existing polling timeout behavior remains unchanged.

raise_on_failure is keyword-only and defaults to False, so existing calls such as:

client.wait_for_task(uid)
client.wait_for_task(uid, 5000, 50)

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Comment @coderabbitai help to get the list of available commands.

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.

1 participant