Fix: Better error management
This commit is contained in:
parent
7f5aeea9b8
commit
8418a5e7f5
@ -126,10 +126,15 @@ class ActionComm extends CommonObject
|
|||||||
// Get id from code
|
// Get id from code
|
||||||
$cactioncomm=new CActionComm($this->db);
|
$cactioncomm=new CActionComm($this->db);
|
||||||
$result=$cactioncomm->fetch($this->type_code);
|
$result=$cactioncomm->fetch($this->type_code);
|
||||||
if ($result)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
$this->type_id=$cactioncomm->id;
|
$this->type_id=$cactioncomm->id;
|
||||||
}
|
}
|
||||||
|
else if ($result == 0)
|
||||||
|
{
|
||||||
|
$this->error='Failed to get record with code AC_OTH from dictionnary "type of events"';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$this->error=$cactioncomm->error;
|
$this->error=$cactioncomm->error;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user