def test_is_minidump(): assert is_minidump_event({ 'exception': { 'values': [{ 'mechanism': { 'type': 'minidump' } }] } }) assert not is_minidump_event({ 'exception': { 'values': [{ 'mechanism': { 'type': 'other' } }] } }) assert not is_minidump_event({ 'exception': { 'values': [{ 'mechanism': { 'type': None } }] } }) assert not is_minidump_event({ 'exception': { 'values': [{ 'mechanism': None }] } }) assert not is_minidump_event({ 'exception': { 'values': [None] } }) assert not is_minidump_event({ 'exception': { 'values': [] } }) assert not is_minidump_event({ 'exception': { 'values': None } }) assert not is_minidump_event({ 'exception': None })
def test_is_minidump(): assert is_minidump_event( {"exception": { "values": [{ "mechanism": { "type": "minidump" } }] }}) assert not is_minidump_event( {"exception": { "values": [{ "mechanism": { "type": "other" } }] }}) assert not is_minidump_event( {"exception": { "values": [{ "mechanism": { "type": None } }] }}) assert not is_minidump_event( {"exception": { "values": [{ "mechanism": None }] }}) assert not is_minidump_event({"exception": {"values": [None]}}) assert not is_minidump_event({"exception": {"values": []}}) assert not is_minidump_event({"exception": {"values": None}}) assert not is_minidump_event({"exception": None})
def get_event_enhancers(self, data): if is_minidump_event(data): return [process_minidump] elif is_applecrashreport_event(data): return [process_applecrashreport] elif is_native_event(data): return [process_payload]
def get_symbolication_function(data): if is_minidump_event(data): return process_minidump elif is_applecrashreport_event(data): return process_applecrashreport elif is_native_event(data): return process_payload
def write_error(e, data): # User fixable but fatal errors are reported as processing # issues. We skip this for minidumps, as reprocessing is not # possible without persisting minidumps. if e.is_user_fixable and e.is_fatal and not is_minidump_event(data): report_processing_issue(data, scope="native", object="dsym:%s" % e.image_uuid, type=e.type, data=e.get_data()) # This in many ways currently does not really do anything. # The reason is that once a processing issue is reported # the event will only be stored as a raw event and no # group will be generated. As a result it also means that # we will not have any user facing event or error showing # up at all. We want to keep this here though in case we # do not want to report some processing issues (eg: # optional difs) if e.is_user_fixable or e.is_sdk_failure: errors = data.setdefault("errors", []) errors.append(e.get_data()) else: logger.debug("Failed to symbolicate with native backend", exc_info=True) if not e.is_user_fixable: data.setdefault("_metrics", {})["flag.processing.error"] = True if e.is_fatal: data.setdefault("_metrics", {})["flag.processing.fatal"] = True
def get_event_enhancers(self, data): rv = [] if is_minidump_event(data): rv.append(reprocess_minidump) if is_native_event(data): rv.append(process_payload) return rv
def get_event_enhancers(self, data): rv = [] if is_minidump_event(data): rv.append(reprocess_minidump) if is_unreal_event(data): rv.append(reprocess_unreal_crash) return rv
def get_event_enhancers(self, data): if is_minidump_event(data): return [reprocess_minidump]