Skip to content

Commit 8bb3b2b

Browse files
committed
Usage statistics: do not crash at any exception
1 parent 9cfa417 commit 8bb3b2b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Orange/canvas/__main__.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,13 @@ def send_usage_statistics():
276276

277277
class SendUsageStatistics(QThread):
278278
def run(self):
279-
usage = UsageStatistics()
280-
usage.send_statistics()
279+
try:
280+
usage = UsageStatistics()
281+
usage.send_statistics()
282+
except Exception: # pylint: disable=broad-except
283+
# unhanled exceptions in threads will crash Orange and nothing
284+
# that happens here should
285+
log.warning("Failed to send usage statistics.")
281286

282287
thread = SendUsageStatistics()
283288
thread.start()

Orange/canvas/document/usagestatistics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,6 @@ def send_statistics(self):
122122
json.dump([], f)
123123
except (ConnectionError, requests.exceptions.RequestException):
124124
log.warning("Connection error while attempting to send usage statistics.")
125-
except Exception:
126-
log.warning("Failed to send usage statistics.")
127125

128126
def write_statistics(self):
129127
if not release:

0 commit comments

Comments
 (0)