Merge pull request #8666 from frederic34/patch-2

Update api_products.class.php
This commit is contained in:
Laurent Destailleur 2018-04-27 09:45:40 +02:00 committed by GitHub
commit e2b936e2d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -289,7 +289,7 @@ class Products extends DolibarrApi
} }
if ($result < 0) { if ($result < 0) {
throw new RestException(503, 'Error when retrieve category list : '.$categories->error); throw new RestException(503, 'Error when retrieve category list : '.array_merge(array($categories->error), $categories->errors));
} }
return $result; return $result;
@ -323,7 +323,7 @@ class Products extends DolibarrApi
} }
if ($result < 0) { if ($result < 0) {
throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
} }
return array( return array(
@ -365,7 +365,7 @@ class Products extends DolibarrApi
} }
if ($result < 0) { if ($result < 0) {
throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
} }
throw new RestException(501, 'Feature not yet available'); throw new RestException(501, 'Feature not yet available');
@ -400,7 +400,7 @@ class Products extends DolibarrApi
} }
if ($result < 0) { if ($result < 0) {
throw new RestException(503, 'Error when retrieve prices list : '.$categories->error); throw new RestException(503, 'Error when retrieve prices list : '.array_merge(array($this->product->error), $this->product->errors));
} }
return array( return array(