Repository navigation
fix(issues): Return 400 for InvalidSearchQuery during bulk delete and update #128414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
0f0534b
c5c5e2b
4bbaa7f
ae04c10
fab7212
95fd651
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| from sentry.apidocs.response_types import ValidationErrorResponse | ||
| from sentry.deletions.defaults.group import GROUP_CHUNK_SIZE | ||
| from sentry.deletions.tasks.groups import delete_groups_for_project | ||
| from sentry.exceptions import InvalidSearchQuery | ||
|
Check failure on line 21 in src/sentry/api/helpers/group_index/delete.py
|
||
| from sentry.models.group import Group, GroupStatus | ||
| from sentry.models.groupinbox import GroupInbox | ||
| from sentry.models.project import Project | ||
|
|
@@ -183,10 +184,13 @@ | |
| { | ||
| "limit": BULK_MUTATION_LIMIT, | ||
| "paginator_options": {"max_limit": BULK_MUTATION_LIMIT}, | ||
| } | ||
| ) | ||
| except (ValidationError, InvalidSearchQuery) as exc: | ||
| # InvalidSearchQuery can be raised while building the Snuba query | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sentry get rid of this comment |
||
| # (e.g. `issue:` with a value that isn't a valid short ID), after | ||
| # parsing has already succeeded. It's a client error, not a 500. | ||
| except ValidationError as exc: | ||
| return Response({"detail": str(exc)}, status=400) | ||
|
Check failure on line 193 in src/sentry/api/helpers/group_index/delete.py
|
||
|
|
||
| group_list = list(cursor_result) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.