isRetryableException() public method

public isRetryableException ( Exception $e, string | null $query = null ) : boolean
$e Exception
$query string | null
return boolean
 /**
  * @param array|null $params
  *
  * @return bool
  *
  * @throws \Exception
  */
 public function execute($params = null)
 {
     $stmt = null;
     $attempt = 0;
     $retry = true;
     while ($retry) {
         $retry = false;
         try {
             $stmt = $this->stmt->execute($params);
         } catch (\Exception $e) {
             if ($this->conn->canTryAgain($attempt) && $this->conn->isRetryableException($e, $this->sql)) {
                 $this->conn->close();
                 $this->createStatement();
                 ++$attempt;
                 $retry = true;
             } else {
                 throw $e;
             }
         }
     }
     return $stmt;
 }