src/Console/Routes/Controller.php
protected function resolveErrorAsPlainText(RequestApplicationInterface $app, \Throwable $exception)
    {
        $data = $this->getErrorData($exception);
        if ($exception instanceof \Reaction\Console\Exception) {
            $this->stdout($this->ansiFormat($data['message'], Console::FG_RED) . "\n");
            return null;
        } else {
            $body = $data['name'] . ' (' . $data['code'] . ')' . "\n";
            $body .= $data['message'] !== "" ? $data['message'] . "\n" : '';
            $body .= $data['file'] !== "" ? $data['file'] : '';
            $body .= $data['line'] !== "" ? " #" . $data['line'] . "\n" : '';
        }

        if (!$exception instanceof HttpException && !empty($data['trace'])) {
            $body .= $data['trace'] . "\n";
        }

        $app->response->setBody($body)
            ->setStatusCodeByException($exception)
            ->setFormat(Response::FORMAT_RAW);
        return $app->response;
    }
protected function resolveErrorAsPlainText(RequestApplicationInterface $app, \Throwable $exception)
    {
        $data = $this->getErrorData($exception);
        if ($exception instanceof \Reaction\Console\Exception) {
            $this->stdout($this->ansiFormat($data['message'], Console::FG_RED) . "\n");
            return null;
        } else {
            $body = $data['name'] . ' (' . $data['code'] . ')' . "\n";
            $body .= $data['message'] !== "" ? $data['message'] . "\n" : '';
            $body .= $data['file'] !== "" ? $data['file'] : '';
            $body .= $data['line'] !== "" ? " #" . $data['line'] . "\n" : '';
        }

        if (!$exception instanceof HttpException && !empty($data['trace'])) {
            $body .= $data['trace'] . "\n";
        }

        $app->response->setBody($body)
            ->setStatusCodeByException($exception)
            ->setFormat(Response::FORMAT_RAW);
        return $app->response;
    }
Resolve error as pain text
@param RequestApplicationInterface $app
@param \Throwable                  $exception
@return ResponseBuilderInterface