From c6629900f3a4965ceca0f42e90648937bf51dfb5 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 12 Aug 2024 03:56:13 +0900 Subject: feat(frontend): improve play page styling --- worker/exec.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'worker/exec.go') 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, } -- cgit v1.2.3-70-g09d2