Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions src/emc/usr_intf/qtvcp/qtvcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,25 @@ def excepthook(self, exc_type, exc_obj, exc_tb):
+ "information may be useful in troubleshooting:\n"
+ 'LinuxCNC Version : %s\n'% self.INFO.LINUXCNC_VERSION)

# Always surface unhandled exceptions to stderr/log. A crash is a
# serious problem that must be visible in CI logs, not buried in a
# dialog that the run never captures.
sys.stderr.write(''.join(lines))
sys.stderr.flush()
LOG.critical("Qtvcp unhandled exception:\n{}".format(''.join(lines)))

# Offscreen (e.g. CI): nobody can dismiss a modal dialog, so
# msg.exec_() below would block forever; if this happens during
# construction it hangs before the SIGTERM handler is armed and the
# process cannot be killed cleanly. Exit instead of popping a dialog.
app = QtWidgets.QApplication.instance()
if app is None or app.platformName() == 'offscreen':
try:
self.shutdown()
except Exception:
pass
os._exit(1)

msg = QtWidgets.QMessageBox()
msg.setIcon(QtWidgets.QMessageBox.Critical)
msg.setText(self._message)
Expand Down