Skip to content

Commit ca88cd9

Browse files
mjqcmanallen
authored andcommitted
fix: add info to post process TypeErrors for debugging (#79099)
Add debugging info to the errors logged to `SENTRY-FOR-SENTRY-2NH2` (a `TypeError`: `unhashable type: 'list'` in `sentry.tasks.post_process.post_process_group`). Lists shouldn't ever show up in the `type` field - trying to track down what's going on.
1 parent e33cfba commit ca88cd9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/sentry/interfaces/contexts.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import string
44
from typing import Any, ClassVar, TypeVar
55

6+
import sentry_sdk
67
from django.utils.encoding import force_str
78

89
from sentry.interfaces.base import Interface
@@ -232,7 +233,12 @@ def to_python(cls, data, **kwargs):
232233
@classmethod
233234
def normalize_context(cls, alias, data):
234235
ctx_type = data.get("type", alias)
235-
ctx_cls = context_types.get(ctx_type, DefaultContextType)
236+
try:
237+
ctx_cls = context_types.get(ctx_type, DefaultContextType)
238+
except TypeError:
239+
# Debugging information for SENTRY-FOR-SENTRY-2NH2.
240+
sentry_sdk.set_context("ctx_type", ctx_type)
241+
raise
236242
return ctx_cls(alias, data)
237243

238244
def iter_contexts(self):

0 commit comments

Comments
 (0)