diff options
Diffstat (limited to 'worker/exec.go')
| -rw-r--r-- | worker/exec.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/worker/exec.go b/worker/exec.go index 9e937f7..37f542b 100644 --- a/worker/exec.go +++ b/worker/exec.go @@ -67,11 +67,14 @@ func execCommandWithTimeout( } } -func convertCommandErrorToResultType(err error) string { +func convertCommandErrorToResultType(err error, isCompile bool) string { if err != nil { if err == context.DeadlineExceeded { return resultTimeout } + if isCompile { + return resultCompileError + } return resultRuntimeError } return resultSuccess @@ -109,7 +112,7 @@ func execSwiftCompile( ) return swiftCompileResponseData{ - Status: convertCommandErrorToResultType(err), + Status: convertCommandErrorToResultType(err, true), Stdout: stdout, Stderr: stderr, } @@ -140,7 +143,7 @@ func execWasmCompile( ) return wasmCompileResponseData{ - Status: convertCommandErrorToResultType(err), + Status: convertCommandErrorToResultType(err, true), Stdout: stdout, Stderr: stderr, } @@ -170,7 +173,7 @@ func execTestRun( ) return testRunResponseData{ - Status: convertCommandErrorToResultType(err), + Status: convertCommandErrorToResultType(err, false), Stdout: stdout, Stderr: stderr, } |
