Skip to content

Commit

Permalink
Merge pull request #238 from boostcampwm2023/dev-be-scoring-server
Browse files Browse the repository at this point in the history
[BE] Fix: return value가 정의되지 않은 값이라면 에러 처리
  • Loading branch information
kushinada2077 authored Dec 7, 2023
2 parents 4ed46d5 + 3409767 commit d758de1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scoring-server/codeRunner.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,15 @@ const attatchChildProcessEvents = (
let status = "fail";
if (childMessages.length == 2) {
memoryUsage = childMessages[1].rss / 1000000;
status =
childMessages[0].toString().trim() == testcase.output ? "pass" : "fail";
if (!childMessages[0]) {
status = "fail";
error += "Error: return value is undefined";
} else {
status =
childMessages[0].toString().trim() == testcase.output
? "pass"
: "fail";
}
} else {
memoryUsage = 0;
status = "fail";
Expand Down

0 comments on commit d758de1

Please sign in to comment.