From 0728cc883201e26153c2861e3b7f6397ad255b26 Mon Sep 17 00:00:00 2001 From: Henrik Nygren Date: Mon, 22 Apr 2019 13:00:39 +0300 Subject: [PATCH] Improve submission error messages --- lib/sandbox_results_saver.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/sandbox_results_saver.rb b/lib/sandbox_results_saver.rb index b9d01fa64..5496e0322 100644 --- a/lib/sandbox_results_saver.rb +++ b/lib/sandbox_results_saver.rb @@ -35,7 +35,7 @@ def self.save_results(submission, results) when '104' "Checkstyle runner error:\n" + results['test_output'] when '105' - 'Missing test output. Did you terminate your program with an exit() command?' + "Missing test output. Did you terminate your program with an exit() command?\nAlso make sure your program did not run out of memory.\nFor example excessive printing (thousands of lines) may cause this." when '137' 'Program was forcibly terminated, most likely due to using too much time or memory.' when nil @@ -43,6 +43,10 @@ def self.save_results(submission, results) else 'Running the submission failed. Exit code: ' + results['exit_code'] + ' (did you use an exit() command?)' end + if submission.stdout.include?('Temporary failure in name resolution: Unknown host maven.mooc.fi') + submission.pretest_error = "Unable to run tests because this course's teacher has not configured this exercise template correctly.\nPlease contact your teacher so that they can fix the template and rerun your submission.\nIf your solution is correct, you'll get the points from this exercise once the teacher reruns your submission." + end + when 'finished' decoded_output = decode_test_output(results['test_output'], results['stderr']) if decoded_output.is_a?(Enumerable)