Fix doxygen, missing error message

This commit is contained in:
Laurent Destailleur 2022-03-18 16:14:20 +01:00
parent 47acdc8f34
commit ed631b2b06
15 changed files with 48 additions and 48 deletions

View File

@ -358,7 +358,7 @@ class Members extends DolibarrApi
if ($member->update(DolibarrApiAccess::$user) >= 0) { if ($member->update(DolibarrApiAccess::$user) >= 0) {
return $this->get($id); return $this->get($id);
} else { } else {
throw new RestException(500, $member->error); throw new RestException(500, 'Error when updating member: '.$member->error);
} }
} }

View File

@ -204,7 +204,7 @@ class MembersTypes extends DolibarrApi
if ($membertype->update(DolibarrApiAccess::$user) >= 0) { if ($membertype->update(DolibarrApiAccess::$user) >= 0) {
return $this->get($id); return $this->get($id);
} else { } else {
throw new RestException(500, $membertype->error); throw new RestException(500, 'Error when updating member type: '.$membertype->error);
} }
} }

View File

@ -159,7 +159,7 @@ class Subscriptions extends DolibarrApi
$subscription->$field = $value; $subscription->$field = $value;
} }
if ($subscription->create(DolibarrApiAccess::$user) < 0) { if ($subscription->create(DolibarrApiAccess::$user) < 0) {
throw new RestException(500, 'Error when creating subscription', array_merge(array($subscription->error), $subscription->errors)); throw new RestException(500, 'Error when creating contribution', array_merge(array($subscription->error), $subscription->errors));
} }
return $subscription->id; return $subscription->id;
} }
@ -193,7 +193,7 @@ class Subscriptions extends DolibarrApi
if ($subscription->update(DolibarrApiAccess::$user) > 0) { if ($subscription->update(DolibarrApiAccess::$user) > 0) {
return $this->get($id); return $this->get($id);
} else { } else {
throw new RestException(500, $subscription->error); throw new RestException(500, 'Error when updating contribution: '.$subscription->error);
} }
} }

View File

@ -126,7 +126,7 @@ class Documents extends DolibarrApi
* @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language). * @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language).
* @return array List of documents * @return array List of documents
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 501 * @throws RestException 501
* @throws RestException 400 * @throws RestException 400
* @throws RestException 401 * @throws RestException 401
@ -249,7 +249,7 @@ class Documents extends DolibarrApi
* @throws RestException 400 * @throws RestException 400
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
* @url GET / * @url GET /
*/ */
@ -546,7 +546,7 @@ class Documents extends DolibarrApi
* @throws RestException 400 * @throws RestException 400
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
* @url POST /upload * @url POST /upload
*/ */

View File

@ -533,7 +533,7 @@ class Proposals extends DolibarrApi
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function deleteContact($id, $contactid, $type) public function deleteContact($id, $contactid, $type)
{ {
@ -707,7 +707,7 @@ class Proposals extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
* @return array * @return array
*/ */

View File

@ -574,7 +574,7 @@ class Orders extends DolibarrApi
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function deleteContact($id, $contactid, $type) public function deleteContact($id, $contactid, $type)
{ {
@ -704,7 +704,7 @@ class Orders extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
* @return array * @return array
*/ */
@ -974,7 +974,7 @@ class Orders extends DolibarrApi
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function getOrderShipments($id) public function getOrderShipments($id)
{ {
@ -1030,7 +1030,7 @@ class Orders extends DolibarrApi
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function createOrderShipment($id, $warehouse_id) public function createOrderShipment($id, $warehouse_id)
{ {

View File

@ -507,7 +507,7 @@ class Invoices extends DolibarrApi
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function deleteContact($id, $contactid, $type) public function deleteContact($id, $contactid, $type)
{ {
@ -649,7 +649,7 @@ class Invoices extends DolibarrApi
$result = $this->invoice->delete(DolibarrApiAccess::$user); $result = $this->invoice->delete(DolibarrApiAccess::$user);
if ($result < 0) { if ($result < 0) {
throw new RestException(500); throw new RestException(500, 'Error when deleting invoice');
} }
return array( return array(
@ -768,7 +768,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
*/ */
public function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0) public function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0)
@ -817,7 +817,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
*/ */
public function settodraft($id, $idwarehouse = -1) public function settodraft($id, $idwarehouse = -1)
@ -920,7 +920,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function settopaid($id, $close_code = '', $close_note = '') public function settopaid($id, $close_code = '', $close_note = '')
{ {
@ -970,7 +970,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function settounpaid($id) public function settounpaid($id)
{ {
@ -1057,7 +1057,7 @@ class Invoices extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function markAsCreditAvailable($id) public function markAsCreditAvailable($id)
{ {

View File

@ -293,7 +293,7 @@ class Donations extends DolibarrApi
* @throws RestException 304 * @throws RestException 304
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
* *
* @return array * @return array
*/ */

View File

@ -401,7 +401,7 @@ class ExpenseReports extends DolibarrApi
* *
* @throws RestException 401 Not allowed * @throws RestException 401 Not allowed
* @throws RestException 404 Expense report not found * @throws RestException 404 Expense report not found
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function put($id, $request_data = null) public function put($id, $request_data = null)
{ {

View File

@ -211,7 +211,7 @@ class SupplierInvoices extends DolibarrApi
* @return int ID of supplier invoice * @return int ID of supplier invoice
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function post($request_data = null) public function post($request_data = null)
{ {
@ -283,7 +283,7 @@ class SupplierInvoices extends DolibarrApi
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function delete($id) public function delete($id)
{ {
@ -300,7 +300,7 @@ class SupplierInvoices extends DolibarrApi
} }
if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) { if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) {
throw new RestException(500); throw new RestException(500, 'Error when deleting invoice');
} }
return array( return array(
@ -326,7 +326,7 @@ class SupplierInvoices extends DolibarrApi
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* @throws RestException 405 * @throws RestException 405
* @throws RestException 500 * @throws RestException 500 System error
*/ */
public function validate($id, $idwarehouse = 0, $notrigger = 0) public function validate($id, $idwarehouse = 0, $notrigger = 0)
{ {

View File

@ -309,7 +309,7 @@ class SupplierOrders extends DolibarrApi
} }
if ($this->order->delete(DolibarrApiAccess::$user) < 0) { if ($this->order->delete(DolibarrApiAccess::$user) < 0) {
throw new RestException(500); throw new RestException(500, 'Error when deleting order');
} }
return array( return array(

View File

@ -742,7 +742,7 @@ class Products extends DolibarrApi
* @param int $fk_barcode_type Barcode type * @param int $fk_barcode_type Barcode type
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url POST {id}/purchase_prices * @url POST {id}/purchase_prices
@ -1158,7 +1158,7 @@ class Products extends DolibarrApi
* @param string $ref_ext External reference of Attribute * @param string $ref_ext External reference of Attribute
* @return array * @return array
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url GET attributes/ref_ext/{ref_ext} * @url GET attributes/ref_ext/{ref_ext}
@ -1206,7 +1206,7 @@ class Products extends DolibarrApi
* @param string $ref_ext Reference of Attribute * @param string $ref_ext Reference of Attribute
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url POST attributes * @url POST attributes
@ -1283,7 +1283,7 @@ class Products extends DolibarrApi
* @param int $id ID of Attribute * @param int $id ID of Attribute
* @return int Result of deletion * @return int Result of deletion
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url DELETE attributes/{id} * @url DELETE attributes/{id}
@ -1311,7 +1311,7 @@ class Products extends DolibarrApi
* @param int $id ID of Attribute value * @param int $id ID of Attribute value
* @return array * @return array
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url GET attributes/values/{id} * @url GET attributes/values/{id}
@ -1352,7 +1352,7 @@ class Products extends DolibarrApi
* @param string $ref Ref of Attribute value * @param string $ref Ref of Attribute value
* @return array * @return array
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url GET attributes/{id}/values/ref/{ref} * @url GET attributes/{id}/values/ref/{ref}
@ -1439,7 +1439,7 @@ class Products extends DolibarrApi
* @return array * @return array
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 500 * @throws RestException 500 System error
* *
* @url GET attributes/{id}/values * @url GET attributes/{id}/values
*/ */
@ -1511,7 +1511,7 @@ class Products extends DolibarrApi
* @param string $value Value of Attribute value * @param string $value Value of Attribute value
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url POST attributes/{id}/values * @url POST attributes/{id}/values
@ -1545,7 +1545,7 @@ class Products extends DolibarrApi
* @return array * @return array
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 500 * @throws RestException 500 System error
* *
* @url PUT attributes/values/{id} * @url PUT attributes/values/{id}
*/ */
@ -1590,7 +1590,7 @@ class Products extends DolibarrApi
* @param int $id ID of Attribute value * @param int $id ID of Attribute value
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url DELETE attributes/values/{id} * @url DELETE attributes/values/{id}
@ -1617,7 +1617,7 @@ class Products extends DolibarrApi
* @param int $includestock Default value 0. If parameter is set to 1 the response will contain stock data of each variant * @param int $includestock Default value 0. If parameter is set to 1 the response will contain stock data of each variant
* @return array * @return array
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url GET {id}/variants * @url GET {id}/variants
@ -1653,7 +1653,7 @@ class Products extends DolibarrApi
* @param string $ref Ref of Product * @param string $ref Ref of Product
* @return array * @return array
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url GET ref/{ref}/variants * @url GET ref/{ref}/variants
@ -1695,7 +1695,7 @@ class Products extends DolibarrApi
* @param string $ref_ext External reference of variant * @param string $ref_ext External reference of variant
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* *
@ -1752,7 +1752,7 @@ class Products extends DolibarrApi
* @param array $features List of attributes pairs id_attribute->id_value. Example: array(id_color=>id_Blue, id_size=>id_small, id_option=>id_val_a, ...) * @param array $features List of attributes pairs id_attribute->id_value. Example: array(id_color=>id_Blue, id_size=>id_small, id_option=>id_val_a, ...)
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* *
@ -1807,7 +1807,7 @@ class Products extends DolibarrApi
* @param array $request_data Datas * @param array $request_data Datas
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url PUT variants/{id} * @url PUT variants/{id}
@ -1841,7 +1841,7 @@ class Products extends DolibarrApi
* @param int $id ID of Variant * @param int $id ID of Variant
* @return int Result of deletion * @return int Result of deletion
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* *
* @url DELETE variants/{id} * @url DELETE variants/{id}
@ -1869,7 +1869,7 @@ class Products extends DolibarrApi
* @param int $selected_warehouse_id ID of warehouse * @param int $selected_warehouse_id ID of warehouse
* @return int * @return int
* *
* @throws RestException 500 * @throws RestException 500 System error
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
* *

View File

@ -1409,7 +1409,7 @@ class Thirdparties extends DolibarrApi
if ($result > 0) { if ($result > 0) {
return array("success" => $result); return array("success" => $result);
} else { } else {
throw new RestException(500); throw new RestException(500, 'Error generating the document '.$this->error);
} }
} }

View File

@ -377,7 +377,7 @@ class Tickets extends DolibarrApi
} }
$this->ticket->message = $ticketMessageText; $this->ticket->message = $ticketMessageText;
if (!$this->ticket->createTicketMessage(DolibarrApiAccess::$user)) { if (!$this->ticket->createTicketMessage(DolibarrApiAccess::$user)) {
throw new RestException(500); throw new RestException(500, 'Error when creating ticket');
} }
return $this->ticket->id; return $this->ticket->id;
} }
@ -438,7 +438,7 @@ class Tickets extends DolibarrApi
} }
if (!$this->ticket->delete($id)) { if (!$this->ticket->delete($id)) {
throw new RestException(500); throw new RestException(500, 'Error when deleting ticket');
} }
return array( return array(

View File

@ -466,7 +466,7 @@ class Users extends DolibarrApi
* *
* @throws RestException 401 Not allowed * @throws RestException 401 Not allowed
* @throws RestException 404 User not found * @throws RestException 404 User not found
* @throws RestException 500 Error * @throws RestException 500 System error
* *
* @url GET {id}/setGroup/{group} * @url GET {id}/setGroup/{group}
*/ */