/** * sets the http status code for this errors response * * @note this does the same as response->set_http_status() except it forces an error status * * @param int $http_status any will do, you can easily pass one of the predefined ones in ::STATUS_* */ public function set_http_status($http_status) { if ($http_status < 400) { throw new \Exception('can not send out errors response with a non-error http status'); } return parent::set_http_status($http_status); }