github.com/criyle/go-sandbox@v0.10.3/runner/status.go (about) 1 package runner 2 3 // Status is the result Status 4 type Status int 5 6 // Result Status for program runner 7 const ( 8 StatusInvalid Status = iota // 0 not initialized 9 // Normal 10 StatusNormal // 1 normal 11 12 // Resource Limit Exceeded 13 StatusTimeLimitExceeded // 2 tle 14 StatusMemoryLimitExceeded // 3 mle 15 StatusOutputLimitExceeded // 4 ole 16 17 // Unauthorized Access 18 StatusDisallowedSyscall // 5 ban 19 20 // Runtime Error 21 StatusSignalled // 6 signalled 22 StatusNonzeroExitStatus // 7 nonzero exit status 23 24 // Programmer Runner Error 25 StatusRunnerError // 8 runner error 26 ) 27 28 var ( 29 statusString = []string{ 30 "Invalid", 31 "", 32 "Time Limit Exceeded", 33 "Memory Limit Exceeded", 34 "Output Limit Exceeded", 35 "Disallowed Syscall", 36 "Signalled", 37 "Nonzero Exit Status", 38 "Runner Error", 39 } 40 ) 41 42 func (t Status) String() string { 43 i := int(t) 44 if i >= 0 && i < len(statusString) { 45 return statusString[i] 46 } 47 return statusString[0] 48 } 49 50 func (t Status) Error() string { 51 return t.String() 52 }