Fix doxygen, missing error message
This commit is contained in:
parent
47acdc8f34
commit
ed631b2b06
@ -358,7 +358,7 @@ class Members extends DolibarrApi
|
||||
if ($member->update(DolibarrApiAccess::$user) >= 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
throw new RestException(500, $member->error);
|
||||
throw new RestException(500, 'Error when updating member: '.$member->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -204,7 +204,7 @@ class MembersTypes extends DolibarrApi
|
||||
if ($membertype->update(DolibarrApiAccess::$user) >= 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
throw new RestException(500, $membertype->error);
|
||||
throw new RestException(500, 'Error when updating member type: '.$membertype->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -159,7 +159,7 @@ class Subscriptions extends DolibarrApi
|
||||
$subscription->$field = $value;
|
||||
}
|
||||
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;
|
||||
}
|
||||
@ -193,7 +193,7 @@ class Subscriptions extends DolibarrApi
|
||||
if ($subscription->update(DolibarrApiAccess::$user) > 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
throw new RestException(500, $subscription->error);
|
||||
throw new RestException(500, 'Error when updating contribution: '.$subscription->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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).
|
||||
* @return array List of documents
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 501
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
@ -249,7 +249,7 @@ class Documents extends DolibarrApi
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url GET /
|
||||
*/
|
||||
@ -546,7 +546,7 @@ class Documents extends DolibarrApi
|
||||
* @throws RestException 400
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url POST /upload
|
||||
*/
|
||||
|
||||
@ -533,7 +533,7 @@ class Proposals extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function deleteContact($id, $contactid, $type)
|
||||
{
|
||||
@ -707,7 +707,7 @@ class Proposals extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@ -574,7 +574,7 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function deleteContact($id, $contactid, $type)
|
||||
{
|
||||
@ -704,7 +704,7 @@ class Orders extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
@ -974,7 +974,7 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function getOrderShipments($id)
|
||||
{
|
||||
@ -1030,7 +1030,7 @@ class Orders extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function createOrderShipment($id, $warehouse_id)
|
||||
{
|
||||
|
||||
@ -507,7 +507,7 @@ class Invoices extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function deleteContact($id, $contactid, $type)
|
||||
{
|
||||
@ -649,7 +649,7 @@ class Invoices extends DolibarrApi
|
||||
|
||||
$result = $this->invoice->delete(DolibarrApiAccess::$user);
|
||||
if ($result < 0) {
|
||||
throw new RestException(500);
|
||||
throw new RestException(500, 'Error when deleting invoice');
|
||||
}
|
||||
|
||||
return array(
|
||||
@ -768,7 +768,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
*/
|
||||
public function addContact($id, $fk_socpeople, $type_contact, $source, $notrigger = 0)
|
||||
@ -817,7 +817,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
*/
|
||||
public function settodraft($id, $idwarehouse = -1)
|
||||
@ -920,7 +920,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function settopaid($id, $close_code = '', $close_note = '')
|
||||
{
|
||||
@ -970,7 +970,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function settounpaid($id)
|
||||
{
|
||||
@ -1057,7 +1057,7 @@ class Invoices extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function markAsCreditAvailable($id)
|
||||
{
|
||||
|
||||
@ -293,7 +293,7 @@ class Donations extends DolibarrApi
|
||||
* @throws RestException 304
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@ -401,7 +401,7 @@ class ExpenseReports extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401 Not allowed
|
||||
* @throws RestException 404 Expense report not found
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
|
||||
@ -211,7 +211,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
* @return int ID of supplier invoice
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function post($request_data = null)
|
||||
{
|
||||
@ -283,7 +283,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@ -300,7 +300,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
}
|
||||
|
||||
if ($this->invoice->delete(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500);
|
||||
throw new RestException(500, 'Error when deleting invoice');
|
||||
}
|
||||
|
||||
return array(
|
||||
@ -326,7 +326,7 @@ class SupplierInvoices extends DolibarrApi
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
* @throws RestException 405
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*/
|
||||
public function validate($id, $idwarehouse = 0, $notrigger = 0)
|
||||
{
|
||||
|
||||
@ -309,7 +309,7 @@ class SupplierOrders extends DolibarrApi
|
||||
}
|
||||
|
||||
if ($this->order->delete(DolibarrApiAccess::$user) < 0) {
|
||||
throw new RestException(500);
|
||||
throw new RestException(500, 'Error when deleting order');
|
||||
}
|
||||
|
||||
return array(
|
||||
|
||||
@ -742,7 +742,7 @@ class Products extends DolibarrApi
|
||||
* @param int $fk_barcode_type Barcode type
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url POST {id}/purchase_prices
|
||||
@ -1158,7 +1158,7 @@ class Products extends DolibarrApi
|
||||
* @param string $ref_ext External reference of Attribute
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url GET attributes/ref_ext/{ref_ext}
|
||||
@ -1206,7 +1206,7 @@ class Products extends DolibarrApi
|
||||
* @param string $ref_ext Reference of Attribute
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url POST attributes
|
||||
@ -1283,7 +1283,7 @@ class Products extends DolibarrApi
|
||||
* @param int $id ID of Attribute
|
||||
* @return int Result of deletion
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url DELETE attributes/{id}
|
||||
@ -1311,7 +1311,7 @@ class Products extends DolibarrApi
|
||||
* @param int $id ID of Attribute value
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url GET attributes/values/{id}
|
||||
@ -1352,7 +1352,7 @@ class Products extends DolibarrApi
|
||||
* @param string $ref Ref of Attribute value
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url GET attributes/{id}/values/ref/{ref}
|
||||
@ -1439,7 +1439,7 @@ class Products extends DolibarrApi
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url GET attributes/{id}/values
|
||||
*/
|
||||
@ -1511,7 +1511,7 @@ class Products extends DolibarrApi
|
||||
* @param string $value Value of Attribute value
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url POST attributes/{id}/values
|
||||
@ -1545,7 +1545,7 @@ class Products extends DolibarrApi
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url PUT attributes/values/{id}
|
||||
*/
|
||||
@ -1590,7 +1590,7 @@ class Products extends DolibarrApi
|
||||
* @param int $id ID of Attribute value
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @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
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url GET {id}/variants
|
||||
@ -1653,7 +1653,7 @@ class Products extends DolibarrApi
|
||||
* @param string $ref Ref of Product
|
||||
* @return array
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url GET ref/{ref}/variants
|
||||
@ -1695,7 +1695,7 @@ class Products extends DolibarrApi
|
||||
* @param string $ref_ext External reference of variant
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
* @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, ...)
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
*
|
||||
@ -1807,7 +1807,7 @@ class Products extends DolibarrApi
|
||||
* @param array $request_data Datas
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url PUT variants/{id}
|
||||
@ -1841,7 +1841,7 @@ class Products extends DolibarrApi
|
||||
* @param int $id ID of Variant
|
||||
* @return int Result of deletion
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
*
|
||||
* @url DELETE variants/{id}
|
||||
@ -1869,7 +1869,7 @@ class Products extends DolibarrApi
|
||||
* @param int $selected_warehouse_id ID of warehouse
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 500
|
||||
* @throws RestException 500 System error
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
*
|
||||
|
||||
@ -1409,7 +1409,7 @@ class Thirdparties extends DolibarrApi
|
||||
if ($result > 0) {
|
||||
return array("success" => $result);
|
||||
} else {
|
||||
throw new RestException(500);
|
||||
throw new RestException(500, 'Error generating the document '.$this->error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -377,7 +377,7 @@ class Tickets extends DolibarrApi
|
||||
}
|
||||
$this->ticket->message = $ticketMessageText;
|
||||
if (!$this->ticket->createTicketMessage(DolibarrApiAccess::$user)) {
|
||||
throw new RestException(500);
|
||||
throw new RestException(500, 'Error when creating ticket');
|
||||
}
|
||||
return $this->ticket->id;
|
||||
}
|
||||
@ -438,7 +438,7 @@ class Tickets extends DolibarrApi
|
||||
}
|
||||
|
||||
if (!$this->ticket->delete($id)) {
|
||||
throw new RestException(500);
|
||||
throw new RestException(500, 'Error when deleting ticket');
|
||||
}
|
||||
|
||||
return array(
|
||||
|
||||
@ -466,7 +466,7 @@ class Users extends DolibarrApi
|
||||
*
|
||||
* @throws RestException 401 Not allowed
|
||||
* @throws RestException 404 User not found
|
||||
* @throws RestException 500 Error
|
||||
* @throws RestException 500 System error
|
||||
*
|
||||
* @url GET {id}/setGroup/{group}
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user