diff --git a/htdocs/product/stock/class/api_warehouses.class.php b/htdocs/product/stock/class/api_warehouses.class.php index e39ede652995d..1af08af0534aa 100644 --- a/htdocs/product/stock/class/api_warehouses.class.php +++ b/htdocs/product/stock/class/api_warehouses.class.php @@ -222,9 +222,9 @@ public function put($id, $request_data = null) if ($this->warehouse->update($id, DolibarrApiAccess::$user)) { return $this->get($id); + } else { + throw new RestException(500, $this->warehouse->error); } - - return false; } /**