forked from Wavyzz/dolibarr
command: forward database error on failure
If the database triggered a failure, it wasn't reported in the tests because $this->error was not set. Conversely, the error was always printed through dol_print_error() whose documentation explicitely states that it should not be used for class and $this->error should be used instead.
This commit is contained in:
@@ -1191,7 +1191,7 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
dol_print_error($this->db);
|
$this->error = $this->db->lasterror();
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user