Skip to content

Commit

Permalink
Report if in main thread when auto report errors is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Czaki committed Oct 16, 2022
1 parent 23f8ce4 commit 7f59296
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package/PartSeg/common_backend/except_hook.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sys

import sentry_sdk
from qtpy.QtCore import QCoreApplication, QThread
from qtpy.QtWidgets import QMessageBox
from superqt import ensure_main_thread

Expand All @@ -21,6 +22,7 @@ def my_excepthook(type_, value, trace_back):
if state_store.report_errors and parsed_version.is_devrelease:
with sentry_sdk.push_scope() as scope:
scope.set_tag("auto_report", "true")
scope.set_tag("main_thread", QCoreApplication.instance().thread() == QThread.currentThread())
sentry_sdk.capture_exception(value)
try:
show_error(value)
Expand Down

0 comments on commit 7f59296

Please sign in to comment.