1
0
mirror of synced 2024-11-22 05:16:09 +03:00

error codes update;

This commit is contained in:
Grisha Pomadchin 2013-07-24 18:27:56 +04:00
parent 12d768772f
commit 1e16626047
2 changed files with 8 additions and 6 deletions

View File

@ -68,6 +68,7 @@ class ICrmOrderActions
// pack mode enable / disable // pack mode enable / disable
// can send data evry 500 rows // can send data evry 500 rows
if (!$steps) { if (!$steps) {
while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset while ($arOrder = $dbOrder->GetNext()) { //here orders by id asc; with offset
$order = self::orderCreate($arOrder['ID'], $api, $arParams); $order = self::orderCreate($arOrder['ID'], $api, $arParams);
@ -79,12 +80,12 @@ class ICrmOrderActions
$lastOrderId = $arOrder['ID']; $lastOrderId = $arOrder['ID'];
} }
if (!empty($resOrders)) { if (!empty($resOrders)) {
$orders = $api->orderUpload($resOrders); $orders = $api->orderUpload($resOrders);
// error pushing orders // error pushing orders
if ($api->getStatusCode() != 200) { if ($api->getStatusCode() != 201) {
//handle err //handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError()); self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError());
@ -92,6 +93,7 @@ class ICrmOrderActions
return false; // in pack mode return errors return false; // in pack mode return errors
} }
} }
} else { // package mode (by default runs after install) } else { // package mode (by default runs after install)
$orderCount = 0; $orderCount = 0;
@ -112,7 +114,7 @@ class ICrmOrderActions
$orders = $api->orderUpload($resOrders); $orders = $api->orderUpload($resOrders);
// error pushing orders // error pushing orders
if ($api->getStatusCode() != 200) { if ($api->getStatusCode() != 201) {
//handle err //handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError()); self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError());
@ -130,7 +132,7 @@ class ICrmOrderActions
$orders = $api->orderUpload($resOrders); $orders = $api->orderUpload($resOrders);
// error pushing orders // error pushing orders
if ($api->getStatusCode() != 200) { if ($api->getStatusCode() != 201) {
//handle err //handle err
self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError()); self::eventLog('ICrmOrderActions::uploadOrders', 'IntaroCrm\RestApi::orderUpload', $api->getLastError());

View File

@ -1,5 +1,5 @@
<? <?
$arModuleVersion = array( $arModuleVersion = array(
'VERSION' => '0.3.5', 'VERSION' => '0.3.5',
'VERSION_DATE' => '2013-07-24 17:28:00', 'VERSION_DATE' => '2013-07-24 18:27:00',
); );