Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.base import cell_silo_endpoint
from sentry.api.bases.project import ProjectEndpoint, ProjectPermission
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.apidocs.constants import (
RESPONSE_BAD_REQUEST,
Expand Down Expand Up @@ -73,7 +72,10 @@ def post(self, request: Request, project: Project) -> Response:
if detector_type == MetricIssue.slug and not features.has(
"organizations:incidents", organization, actor=request.user
):
raise ResourceDoesNotExist
return Response(
serialize({"detail": "Unable to process request, confirm payment options."}),
status=status.HTTP_400_BAD_REQUEST,
)

validator = get_detector_validator(request, project, detector_type)
if not validator.is_valid():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ def test_without_feature_flag(self) -> None:
self.organization.slug,
self.project.slug,
**self.valid_data,
status_code=404,
status_code=400,
)
assert response.data == {
"detail": ErrorDetail(string="The requested resource does not exist", code="error")
"detail": ErrorDetail(
string="Unable to process request, confirm payment options.", code="error"
)
}

def test_project_not_found(self) -> None:
Expand Down
Loading