Exemple #1
1
 public function __construct($message = '', $code = 0, Exception $e = null)
 {
     if ($e && 0 === $code) {
         $code = $e->getCode();
     }
     parent::__construct($message, $code, $e);
 }
 /**
  * @param Zend_Db_Exception $ex
  * @throws Zend_Db_Exception
  */
 protected function catchDbException(Zend_Db_Exception $ex)
 {
     if (strpos($ex->getMessage(), self::SERVER_GONE_MESSAGE) !== false || strpos($ex->getMessage(), self::CONNECTION_REFUSED_MESSAGE) !== false || strpos($ex->getMessage(), self::LINK_FAILURE_MESSAGE) !== false) {
         $this->closeConnection();
         sleep(self::SLEEP_BETWEEN_ATTEMPTS);
     } else {
         throw $ex;
     }
 }
Exemple #3
0
 public function __construct($message = null, Exception $e = null)
 {
     if ($e) {
         $this->_chainedException = $e;
         $this->code = $e->getCode();
     }
     parent::__construct($message);
 }
Exemple #4
0
 /**
  * String representation of the exception
  *
  * @return string
  */
 public function __toString()
 {
     $str = parent::__toString();
     if ($this->sql) {
         $str .= "\n\n" . $this->sql;
     }
     if (!empty($this->bindings)) {
         $str .= "\nBindings:";
         foreach ($this->bindings as $name => $expr) {
             $str .= "\n\t" . $name . " \t->  " . $expr;
         }
     }
     return $str;
 }
 public function __construct($message = null, Exception $e = null)
 {
     $this->_chainedException = $e;
     parent::__construct($message);
 }