diff --git a/events/utils.py b/events/utils.py index 12b2f5c..382b2fd 100644 --- a/events/utils.py +++ b/events/utils.py @@ -167,6 +167,12 @@ def apply_sourcemaps(event_data): frame['function'] = token.name # frame["colno"] = token.src_col + TO_DISPLAY not actually used + elif frame.get("filename") in debug_id_for_filename: + # The event_data reports that a debug_id is available for this filename, but we don't have it; this + # could be because the sourcemap was not uploaded. We want to show the debug_id in the stacktrace as + # a hint to the user that they should upload the sourcemap. + frame["debug_id"] = str(debug_id_for_filename[frame["filename"]]) + def get_sourcemap_images(event_data): # NOTE: butchered copy/paste of apply_sourcemaps; refactoring for DRY is a TODO diff --git a/issues/templates/issues/stacktrace.html b/issues/templates/issues/stacktrace.html index 65ded14..6036c72 100644 --- a/issues/templates/issues/stacktrace.html +++ b/issues/templates/issues/stacktrace.html @@ -146,7 +146,11 @@ {% if "context_line" not in frame or frame.context_line is None %}{% if not frame.vars %}{# nested ifs as a subsitute for brackets-in-templates #}
- No code context or variables available for this frame. + {% if frame.debug_id %}{# only in the no-vars-either case to avoid excessive if-nesting (at the cost of completeness, but "will yes-vars, broken debug_id even be a case? For now we hope not) #} + No sourcemaps found for Debug ID {{ frame.debug_id }} + {% else %} + No code context or variables available for this frame. + {% endif %}
{% endif %}{% endif %}