public function execute() { try { $result = parent::execute(); } catch (\Exception $e) { if ($this->app->httpResponse()->responseCode() == 200) { $this->app->httpResponse()->addHeader('HTTP/1.0 500 Internal Server Error'); } $this->app->httpResponse()->addHeader('Content-Type: text/plain'); $this->responseContent()->setValue($e->getMessage()); return; } return $result; }