Browse Source

Show exception-content for broken question files

Sebastian Lohff 6 years ago
parent
commit
160cf5ac4c
1 changed files with 7 additions and 2 deletions
  1. 7
    2
      seopardy.py

+ 7
- 2
seopardy.py View File

@@ -7,7 +7,7 @@ import sys
7 7
 from PySide import QtGui, QtCore
8 8
 
9 9
 from music import MusicBox
10
-from question import Questions
10
+from question import Questions, QuestionException
11 11
 from gamestate import GameState
12 12
 from game import SeopardyGame
13 13
 from config import check_config
@@ -24,7 +24,12 @@ if __name__ == '__main__':
24 24
 	parser = _parser()
25 25
 	args = parser.parse_args()
26 26
 
27
-	questions = Questions(args.questions)
27
+	questions = None
28
+	try:
29
+		questions = Questions(args.questions)
30
+	except QuestionException as e:
31
+		print(str(e), file=sys.stderr)
32
+		sys.exit(1)
28 33
 
29 34
 	# start gui
30 35
 	app = QtGui.QApplication([sys.argv[0]])

Loading…
Cancel
Save