mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
try/catch around edit-saver
This commit is contained in:
@@ -302,10 +302,14 @@ class QSO extends CI_Controller {
|
||||
}
|
||||
$this->form_validation->set_rules('time_on', 'Start Date', 'required');
|
||||
$this->form_validation->set_rules('time_off', 'End Date', 'required');
|
||||
$this->form_validation->set_rules('id', 'qso ID', 'required');
|
||||
|
||||
$edit_result['success']=false;
|
||||
if ($this->form_validation->run()) {
|
||||
$this->logbook_model->edit();
|
||||
$edit_result=$this->logbook_model->edit();
|
||||
}
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode($edit_result);
|
||||
}
|
||||
|
||||
function qsl_rcvd($id, $method) {
|
||||
|
||||
@@ -1528,7 +1528,16 @@ class Logbook_model extends CI_Model {
|
||||
}
|
||||
|
||||
$this->db->where('COL_PRIMARY_KEY', $this->input->post('id'));
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
$retvals=[];
|
||||
try {
|
||||
$this->db->update($this->config->item('table_name'), $data);
|
||||
$retvals['success']=true;
|
||||
} catch (Exception $e) {
|
||||
$retvals['success']=false;
|
||||
$retvals['detail']=$e;
|
||||
} finally {
|
||||
return($retvals);
|
||||
}
|
||||
}
|
||||
|
||||
/* QSL received */
|
||||
|
||||
Reference in New Issue
Block a user