2
0
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:
Alexandre Janniaux
2023-11-19 14:56:25 +01:00
parent c512effb03
commit d9e81cbabe

View File

@@ -1191,7 +1191,7 @@ class Commande extends CommonOrder
return 0;
} else {
dol_print_error($this->db);
$this->error = $this->db->lasterror();
$this->db->rollback();
return -1;
}