aboutsummaryrefslogtreecommitdiffhomepage
path: root/worker/exec.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-12 03:56:13 +0900
committernsfisis <nsfisis@gmail.com>2024-08-12 04:28:59 +0900
commitc6629900f3a4965ceca0f42e90648937bf51dfb5 (patch)
tree665b2b33d8a97754e2abfaaf436ab98ff7572ec4 /worker/exec.go
parentfbeacd47a9c21a06a3188ad03f8b639a8f48a433 (diff)
downloadphperkaigi-2025-albatross-c6629900f3a4965ceca0f42e90648937bf51dfb5.tar.gz
phperkaigi-2025-albatross-c6629900f3a4965ceca0f42e90648937bf51dfb5.tar.zst
phperkaigi-2025-albatross-c6629900f3a4965ceca0f42e90648937bf51dfb5.zip
feat(frontend): improve play page styling
Diffstat (limited to 'worker/exec.go')
-rw-r--r--worker/exec.go11
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,
}