public function writeException(\Exception $e)
    {
        $this->lastExecSuccess = false;
        $this->context->setLastException($e);
        $this->output->writeln($this->formatException($e));
        $this->resetCodeBuffer();
    }