/** * @see parent * * @param Bronto_Api $api * @param Bronto_Api_Exception $exception */ public function onError(Bronto_Api $api, Bronto_Api_Exception $exception) { if ($exception instanceof Bronto_Api_Exception) { if ($request = $api->getLastRequest()) { Mage::helper('bronto_common')->writeDebug(var_export($request, true)); } if ($response = $api->getLastResponse()) { Mage::helper('bronto_common')->writeDebug(var_export($response, true)); } } }
/** * Write the API delivery flush * * @param Bronto_Api $api */ protected function _flushLogs(Bronto_Api $api) { $helper = Mage::helper($this->_helper); $apiLog = "{$this->_helper}_api.log"; $helper->writeVerboseDebug("===== {$helper->getName()} Delivery =====", $apiLog); $helper->writeVerboseDebug(var_export($api->getLastRequest(), true), $apiLog); $helper->writeVerboseDebug(var_export($api->getLastResponse(), true), $apiLog); }
/** * Writes the contact save logs * * @param Bronto_Api $api * @return void */ protected function _flushApiLogs($api) { $this->writeVerboseDebug('===== CONTACT SAVE =====', 'bronto_common_api.log'); $this->writeVerboseDebug(var_export($api->getLastRequest(), true), 'bronto_common_api.log'); $this->writeVerboseDebug(var_export($api->getLastResponse(), true), 'bronto_common_api.log'); }