Skip to content

Commit

Permalink
Make sure core_restart_logs are always on reported error
Browse files Browse the repository at this point in the history
  • Loading branch information
xoriole committed Jan 17, 2024
1 parent e45b386 commit aeb230d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/tribler/gui/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,13 @@ def gui_error(self, exc_type, exc, tb):
type=type(exc_type).__name__,
text=text,
event=gui_sentry_reporter.event_from_exception(exc),
additional_information={"core_restart_logs": self.tribler_window.core_manager.core_restart_logs}
)

is_core_exception = issubclass(exc_type, CoreError)
if is_core_exception:
self._logger.info('It is a subclass of CoreError exception')

reported_error.additional_information.update({
"core_restart_logs": self.tribler_window.core_manager.core_restart_logs
})
reported_error.last_core_output = self.tribler_window.core_manager.get_last_core_output(quoted=False)
quoted_output = self.tribler_window.core_manager.get_last_core_output()
self._logger.info(f'Last Core output:\n{quoted_output}')
Expand Down Expand Up @@ -94,15 +92,17 @@ def core_error(self, reported_error: ReportedError):
if self._tribler_stopped or reported_error.type in self._handled_exceptions:
return

# Add core restart logs to the reported error before sending to sentry
reported_error.additional_information.update({
"core_restart_logs": self.tribler_window.core_manager.core_restart_logs
})

self._logger.info(f'Processing Core error: {reported_error}')
process_manager = self.tribler_window.process_manager
process_manager.current_process.set_error(f"Core {reported_error.type}: {reported_error.text}")

SentryScrubber.remove_breadcrumbs(reported_error.event)
gui_sentry_reporter.additional_information.update(reported_error.additional_information)
gui_sentry_reporter.additional_information.update({
"core_restart_logs": self.tribler_window.core_manager.core_restart_logs
})

additional_tags = {
'source': 'core',
Expand Down

0 comments on commit aeb230d

Please sign in to comment.