Skip to content

EspoCRM – Open Source CRM Application

Add throw

Yurii084d03f846c3
diff --git a/application/Espo/ORM/Executor/DefaultSqlExecutor.php b/application/Espo/ORM/Executor/DefaultSqlExecutor.php
index f2081f0593..d56ef9ef9a 100644
--- a/application/Espo/ORM/Executor/DefaultSqlExecutor.php
+++ b/application/Espo/ORM/Executor/DefaultSqlExecutor.php
@@ -70,6 +70,9 @@ class DefaultSqlExecutor implements SqlExecutor
return $this->executeSqlWithDeadlockHandling($sql);
}
+ /**
+ * @throws DeadlockException
+ */
private function executeSqlWithDeadlockHandling(string $sql, ?int $counter = null): PDOStatement
{
$counter = $counter ?? self::MAX_ATTEMPT_COUNT;
diff --git a/application/Espo/ORM/Executor/SqlExecutor.php b/application/Espo/ORM/Executor/SqlExecutor.php
index 128ab66a07..a8008b9561 100644
--- a/application/Espo/ORM/Executor/SqlExecutor.php
+++ b/application/Espo/ORM/Executor/SqlExecutor.php
@@ -29,6 +29,7 @@
namespace Espo\ORM\Executor;
+use Espo\ORM\Exceptions\DeadlockException;
use PDOStatement;
/**
@@ -38,6 +39,8 @@ interface SqlExecutor
{
/**
* Execute a query.
+ *
+ * @throws DeadlockException
*/
public function execute(string $sql, bool $rerunIfDeadlock = false): PDOStatement;
}