Skip to content

Commit 9d66300

Browse files
committed
Improve submission error messages
1 parent 7ecaee6 commit 9d66300

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/sandbox_results_saver.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@ def self.save_results(submission, results)
3535
when '104'
3636
"Checkstyle runner error:\n" + results['test_output']
3737
when '105'
38-
'Missing test output. Did you terminate your program with an exit() command?'
38+
'Missing test output. Did you terminate your program with an exit() command? Also make sure your program did not run out of memory. For example excessive printing (thousands of lines) may cause this.'
3939
when '137'
4040
'Program was forcibly terminated, most likely due to using too much time or memory.'
4141
when nil
4242
'Running the submission failed.'
4343
else
4444
'Running the submission failed. Exit code: ' + results['exit_code'] + ' (did you use an exit() command?)'
4545
end
46+
if submission.stdout.include?('Temporary failure in name resolution: Unknown host maven.mooc.fi')
47+
submission.pretest_error = "Unable to run tests because this course's teacher has not configured this exercise template correctly. Please contact your teacher so that they can fix the template and rerun your submission. If your solution is correct, you'll get the points from this exercise once the teacher reruns your submission."
48+
end
49+
4650
when 'finished'
4751
decoded_output = decode_test_output(results['test_output'], results['stderr'])
4852
if decoded_output.is_a?(Enumerable)

0 commit comments

Comments
 (0)