Skip to content

fix: return 400 for invalid webhook configuration - #463

Merged
suguanYang merged 1 commit into
mainfrom
fix/suguanYang/webhook-config-exception-details
Oct 16, 2026
Merged

suguanYang merged 1 commit into
mainfrom
fix/suguanYang/webhook-config-exception-details

Conversation

@suguanYang

Copy link
Copy Markdown
Contributor

Summary

  • WebhookConfigException was storing details as None, so POST /v2/jobs with an invalid webhook (for example a localhost URL) crashed in the exception handler and returned 500 UnknownException instead of 400.
  • Pass details through to KnowhereException, and read retry_after from exc.details or {} so a missing details dict cannot turn a client error into a server error.
  • Add a contract test that raises the same webhook configuration exception and expects 400 INVALID_ARGUMENT.

Test plan

  • uv run pytest tests/contract/test_exception_handlers_contract.py::test_invalid_webhook_config_returns_client_error
  • After deploy, confirm a POST /v2/jobs with a localhost webhook returns 400 Invalid webhook URL and does not emit UnknownException in Logfire.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@suguanYang
suguanYang merged commit 328d21a into main Oct 16, 2026
6 checks passed
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