diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index d48740ea68d62..9a9320e489766 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -632,8 +632,10 @@ public function put($id, $request_data = null) } } - if ($this->invoice->update(DolibarrApiAccess::$user)) { + if ($this->invoice->update(DolibarrApiAccess::$user) > 0) { return $this->get($id); + } else { + throw new RestException(500, $this->invoice->error); } return false;