Update response/error handling

This commit is contained in:
ma0068
2024-01-18 07:45:08 +01:00
parent 364c3f0518
commit bd4bbe0b7a
5 changed files with 27 additions and 26 deletions
+9 -2
View File
@@ -156,14 +156,21 @@ class Notiz_model extends DB_Model
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
//check if valid type
$isValidType = $this->NotizzuordnungModel->isValidType($type);
$result = $this->NotizzuordnungModel->isValidType($type);
if (isError($result))
{
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
$result = error($result->retval, EXIT_ERROR);
return $result;
}
/*
if(!$isValidType)
{
//Todo manu (correct return to controller)
$msg = "datatype " . $type . " not implemented for notes";
return error($msg, EXIT_ERROR);
}
}*/
// Start DB transaction
$this->db->trans_start(false);