diff options
Diffstat (limited to 'worker')
| -rw-r--r-- | worker/exec.go | 11 | ||||
| -rw-r--r-- | worker/models.go | 1 |
2 files changed, 8 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, } diff --git a/worker/models.go b/worker/models.go index 9f60eb0..4a318d0 100644 --- a/worker/models.go +++ b/worker/models.go @@ -7,6 +7,7 @@ import ( const ( resultSuccess = "success" + resultCompileError = "compile_error" resultRuntimeError = "runtime_error" resultTimeout = "timeout" resultInternalError = "internal_error" |
