/[openfoncier]/trunk/services/metier/metiermanager.php
ViewVC logotype

Diff of /trunk/services/metier/metiermanager.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 559 by mlimic, Tue Oct 30 17:05:34 2012 UTC revision 564 by mlimic, Wed Oct 31 12:23:19 2012 UTC
# Line 232  class MetierManager { Line 232  class MetierManager {
232       */       */
233      protected function checkDBError($result, $msg = '') {      protected function checkDBError($result, $msg = '') {
234          if (database::isError($result, true)) {          if (database::isError($result, true)) {
235              $this->setMessage($msg.$this->formatDBerror($result->getDebugInfo(),              $this->addToLog("Error: $msg ".
236                                          $result->getMessage()));                      $this->formatDBerror($result->getDebugInfo(),
237                        $result->getMessage()));
238                $this->setMessage('ERREUR DE LA BD : '. $msg);
239              return true;              return true;
240          }          }
241          return false;          return false;
242      }      }
243            
244        
245        /*
246         * Adds errors to log
247         * @param string $message The message to add to log
248         * @param string $type The logging mode
249         * @todo what do we do with DB error messages if a REST call is made
250         */
251        function addToLog($message, $type = DEBUG_MODE) {
252            //
253            if (!defined('REST_REQUEST')) {
254                logger::instance()->log("class ".get_class($this)." - ".$message, $type);
255            }
256        }
257        
258  }// fin classe  }// fin classe
259  ?>  ?>

Legend:
Removed from v.559  
changed lines
  Added in v.564

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26