forked from M-Labs/artiq
1
0
Fork 0

gui/explorer: less verbose error dialogs

This commit is contained in:
Sebastien Bourdeauducq 2015-08-22 21:05:05 +08:00
parent 42e87c060e
commit 21a28a13c9
1 changed files with 3 additions and 4 deletions

View File

@ -1,5 +1,4 @@
import asyncio import asyncio
import traceback
from quamash import QtGui, QtCore from quamash import QtGui, QtCore
from pyqtgraph import dockarea from pyqtgraph import dockarea
@ -136,12 +135,12 @@ class _ArgumentSetter(LayoutWidget):
for arg, entry in self._args_to_entries.items(): for arg, entry in self._args_to_entries.items():
try: try:
r[arg] = entry.get_argument_value() r[arg] = entry.get_argument_value()
except: except Exception as e:
if show_error_message: if show_error_message:
msgbox = QtGui.QMessageBox(self.dialog_parent) msgbox = QtGui.QMessageBox(self.dialog_parent)
msgbox.setWindowTitle("Error") msgbox.setWindowTitle("Error")
msgbox.setText("Failed to obtain value for argument '{}'.\n{}" msgbox.setText("Failed to obtain value for argument '{}':\n{}"
.format(arg, traceback.format_exc())) .format(arg, str(e)))
msgbox.setStandardButtons(QtGui.QMessageBox.Ok) msgbox.setStandardButtons(QtGui.QMessageBox.Ok)
msgbox.show() msgbox.show()
return None return None