Commit 98e409cf026b4b5bb267de18ba3d262b27532d8c

Authored by Miguel Barao
1 parent 0ebed213
Exists in master and in 1 other branch dev

- improved error message for scripts not found.

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
@@ -113,7 +113,7 @@ def question_generator(q): @@ -113,7 +113,7 @@ def question_generator(q):
113 try: 113 try:
114 p = subprocess.Popen([q['script']], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) 114 p = subprocess.Popen([q['script']], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
115 except FileNotFoundError: 115 except FileNotFoundError:
116 - print(' * Script {0} defined in question {1} could not be found'.format(q['script'], q['ref'])) 116 + print(' * Script "{0}" defined in question "{1}" of file "{2}" could not be found'.format(q['script'], q['ref'], q['filename']))
117 117
118 try: 118 try:
119 qyaml = p.communicate(input=q['stdin'].encode('utf-8'), timeout=5)[0].decode('utf-8') 119 qyaml = p.communicate(input=q['stdin'].encode('utf-8'), timeout=5)[0].decode('utf-8')
@@ -378,7 +378,7 @@ class QuestionTextArea(Question): @@ -378,7 +378,7 @@ class QuestionTextArea(Question):
378 try: 378 try:
379 p = subprocess.Popen([self['correct']], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) 379 p = subprocess.Popen([self['correct']], stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)
380 except FileNotFoundError as e: 380 except FileNotFoundError as e:
381 - print(' * Script "{0}" defined in question "{1}" could not be found'.format(self['correct'], self['ref'])) 381 + print(' * Script "{0}" defined in question "{1}" of file "{2}" could not be found'.format(self['correct'], self['ref'], self['filename']))
382 raise e 382 raise e
383 383
384 try: 384 try: