diff --git a/src/Plugins/EvalCode.php b/src/Plugins/EvalCode.php index c41b2d8..9c512f3 100644 --- a/src/Plugins/EvalCode.php +++ b/src/Plugins/EvalCode.php @@ -99,7 +99,12 @@ private function getMessageText(string $title, string $output, string $url): str private function generateMessageFromOutput(array $output, string $url): string { - return $this->getMessageText($output["versions"], htmlspecialchars_decode($output["output"]), $url); + $text = htmlspecialchars_decode($output["output"]); + + if (preg_match('~^(?P.*)
Process exited with code (?P\d+)\.$~s', $text, $m)) + $text = sprintf('%s (process exited with %s code %d)', $m['raw'], $m['errName'], $m['errCode']); + + return $this->getMessageText($output["versions"], $text, $url); } private function doEval(HttpRequest $request, Command $command): \Generator