FHCAPI Controller: optional status param for error function

This commit is contained in:
cgfhtw
2024-03-11 15:23:54 +01:00
parent b359a77a8d
commit 40c98b1dcc
+3 -2
View File
@@ -181,11 +181,12 @@ class FHCAPI_Controller extends Auth_Controller
/**
* @param array $error
* @param string $type (optional)
* @param integer $status (optional)
* @return void
*/
protected function terminateWithError($error, $type = null)
protected function terminateWithError($error, $type = null, $status = REST_Controller::HTTP_INTERNAL_SERVER_ERROR)
{
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
$this->output->set_status_header($status);
$this->addError($error, $type);
$this->setStatus(self::STATUS_ERROR);
exit;