public function testIgnoresOtherPdoExceptions() { $code = 2002; $message = "SQLSTATE[HY000] [2002] Connection reset by peer"; $pdoException = new \PDOException($message, $code); $this->assertFalse(RuntimeException::hasServerGoneAway($pdoException)); }
/** * @param bool $hasCaughtException * @return bool */ protected function doBeginTransaction($hasCaughtException = false) { try { return $this->getConnection()->beginTransaction(); } catch (\PDOException $exception) { if (RuntimeException::hasServerGoneAway($exception) && !$hasCaughtException) { $this->reconnect(); return $this->doBeginTransaction(true); } throw RuntimeException::createFromException($exception); } }