Skip to content

Commit d9d3286

Browse files
authored
Merge pull request #1923 from nikicc/sentry-names
[RFC] ErrorReporting: Report developer names to Sentry
2 parents 5ff92a9 + d684c84 commit d9d3286

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

Orange/canvas/application/errorreporting.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ def _find_widget_frame(tb):
190190
packages = ', '.join(sorted("%s==%s" % (i.project_name, i.version)
191191
for i in pip.get_installed_distributions()))
192192

193+
machine_id = QSettings().value('error-reporting/machine-id', '', type=str)
194+
193195
# If this exact error was already reported in this session,
194196
# just warn about it
195197
if (err_module, widget_module) in cls._cache:
@@ -227,7 +229,7 @@ def _find_widget_frame(tb):
227229
platform.python_version(), platform.system(), platform.release(),
228230
platform.version(), platform.machine())
229231
data[F.INSTALLED_PACKAGES] = packages
230-
data[F.MACHINE_ID] = str(uuid.getnode())
232+
data[F.MACHINE_ID] = machine_id or str(uuid.getnode())
231233
data[F.STACK_TRACE] = stacktrace
232234
if err_locals:
233235
data[F.LOCALS] = err_locals

Orange/canvas/application/settings.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from AnyQt.QtWidgets import (
1717
QWidget, QMainWindow, QComboBox, QCheckBox, QListView, QTabWidget,
1818
QToolBar, QAction, QStackedWidget, QVBoxLayout, QHBoxLayout,
19-
QFormLayout, QSizePolicy
19+
QFormLayout, QSizePolicy, QLineEdit,
2020
)
2121

2222
from AnyQt.QtCore import (
@@ -359,6 +359,17 @@ def __setupUi(self):
359359

360360
tab.setLayout(form)
361361

362+
# Error Reporting Tab
363+
tab = QWidget()
364+
self.addTab(tab, self.tr("Error Reporting"),
365+
toolTip="Settings related to error reporting")
366+
367+
form = QFormLayout()
368+
line_edit_mid = QLineEdit()
369+
self.bind(line_edit_mid, "text", "error-reporting/machine-id")
370+
form.addRow("Machine ID:", line_edit_mid)
371+
tab.setLayout(form)
372+
362373
if self.__macUnified:
363374
# Need some sensible size otherwise mac unified toolbar 'takes'
364375
# the space that should be used for layout of the contents

Orange/canvas/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ def init():
114114
("logging/dockable", bool, True, "Allow log window to be docked"),
115115

116116
("help/open-in-external-browser", bool, False,
117-
"Open help in an external browser")
117+
"Open help in an external browser"),
118+
119+
("error-reporting/machine-id", str, '',
120+
"Report custom name instead of machine ID"),
118121
]
119122

120123
spec = [config_slot(*t) for t in spec]

0 commit comments

Comments
 (0)