Skip to content

Commit 5e4a300

Browse files
committed
better 404 handling
1 parent 757554f commit 5e4a300

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/sentry/utils/snuba_rpc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sentry_sdk.scope
1212
import urllib3
1313
from google.protobuf.message import Message as ProtobufMessage
14+
from rest_framework.exceptions import NotFound
1415
from sentry_protos.snuba.v1.endpoint_create_subscription_pb2 import (
1516
CreateSubscriptionRequest,
1617
CreateSubscriptionResponse,
@@ -277,6 +278,8 @@ def _make_rpc_request(
277278
error.ParseFromString(http_resp.data)
278279
if SNUBA_INFO:
279280
log_snuba_info(f"{referrer}.error:\n{error}")
281+
if http_resp.status == 404:
282+
raise NotFound() from SnubaRPCError(error)
280283
raise SnubaRPCError(error)
281284
return http_resp
282285

0 commit comments

Comments
 (0)