aboutsummaryrefslogtreecommitdiffhomepage
path: root/worker
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
parentfbeacd47a9c21a06a3188ad03f8b639a8f48a433 (diff)
downloadiosdc-japan-2024-albatross-c6629900f3a4965ceca0f42e90648937bf51dfb5.tar.gz
iosdc-japan-2024-albatross-c6629900f3a4965ceca0f42e90648937bf51dfb5.tar.zst
iosdc-japan-2024-albatross-c6629900f3a4965ceca0f42e90648937bf51dfb5.zip
feat(frontend): improve play page styling
Diffstat (limited to 'worker')
-rw-r--r--worker/exec.go11
-rw-r--r--worker/models.go1
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"