mirror of
https://github.com/bugsink/bugsink.git
synced 2025-12-21 13:00:13 -06:00
Move vendored code into explicitly licenced dir
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from django.utils.encoding import force_str
|
||||
|
||||
from sentry.stacktraces.functions import get_function_name_for_frame
|
||||
from sentry.stacktraces.processing import get_crash_frame_from_event_data
|
||||
from sentry.stacktraces.processing import get_crash_frame_from_event_data, get_crash_location
|
||||
from sentry.utils.safe import get_path, trim
|
||||
|
||||
from sentry.utils.strings import strip
|
||||
@@ -33,17 +33,6 @@ def get_exception_type_and_value_for_logmessage(data):
|
||||
return "Log Message", "<no log message>"
|
||||
|
||||
|
||||
def get_crash_location(data):
|
||||
frame = get_crash_frame_from_event_data(
|
||||
data,
|
||||
frame_filter=lambda x: x.get("function") not in (None, "<redacted>", "<unknown>"),
|
||||
)
|
||||
if frame is not None:
|
||||
func = get_function_name_for_frame(frame, data.get("platform"))
|
||||
return frame.get("filename") or frame.get("abs_path"), func
|
||||
return None, None
|
||||
|
||||
|
||||
def get_exception_type_and_value_for_exception(data):
|
||||
"""Extracts the type and value of the exception from the event data. The non-trivial part is that we have to handle
|
||||
multiple exceptions in a chain, missing values, and synthetic exceptions."""
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from sentry.stacktraces.functions import get_function_name_for_frame
|
||||
from sentry.utils.safe import get_path
|
||||
|
||||
|
||||
@@ -24,3 +25,17 @@ def get_crash_frame_from_event_data(data, frame_filter=None):
|
||||
|
||||
if default:
|
||||
return default
|
||||
|
||||
|
||||
def get_crash_location(data):
|
||||
# This function lives in a different file in the Sentry codebase (sentry/eventtypes/error.py), but it made its way
|
||||
# here because that file didn't make it to the part of Sentry that we vendored.
|
||||
|
||||
frame = get_crash_frame_from_event_data(
|
||||
data,
|
||||
frame_filter=lambda x: x.get("function") not in (None, "<redacted>", "<unknown>"),
|
||||
)
|
||||
if frame is not None:
|
||||
func = get_function_name_for_frame(frame, data.get("platform"))
|
||||
return frame.get("filename") or frame.get("abs_path"), func
|
||||
return None, None
|
||||
|
||||
Reference in New Issue
Block a user