Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/sentry/api/helpers/group_index/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Comment thread
sentry-warden[bot] marked this conversation as resolved.
from sentry.models.group import Group, GroupStatus
from sentry.models.groupinbox import GroupInbox
from sentry.models.project import Project
Expand Down Expand Up @@ -185,8 +186,11 @@
"paginator_options": {"max_limit": BULK_MUTATION_LIMIT},
}
)
except ValidationError as exc:
except (ValidationError, InvalidSearchQuery) as exc:
# InvalidSearchQuery can be raised while building the Snuba query

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.
return Response({"detail": str(exc)}, status=400)

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.

group_list = list(cursor_result)

Expand Down
5 changes: 5 additions & 0 deletions src/sentry/api/helpers/group_index/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from sentry.api.serializers import serialize
from sentry.api.serializers.models.actor import ActorSerializer, ActorSerializerResponse
from sentry.api.serializers.models.groupactionlogentry import get_serialized_activity_items
from sentry.exceptions import InvalidSearchQuery
from sentry.hybridcloud.rpc import coerce_id_from
from sentry.integrations.tasks.kick_off_status_syncs import kick_off_status_syncs
from sentry.issues.action_log import (
Expand Down Expand Up @@ -332,6 +333,10 @@
return Response(
{"detail": "Invalid query. Error getting group ids and group list"}, status=400
)
except InvalidSearchQuery as exc:
# Raised while building the Snuba query (e.g. `issue:` with an
# invalid short ID). This is a client error; don't report it.
return Response({"detail": str(exc)}, status=400)
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed

group_list = list(cursor_result)

Expand Down
Loading