Browse Source

Merge pull request #17103 from cakephp/query-debuginfo

Catch all exceptions when generating sql for Query::__debugInfo()
Mark Scherer 3 years ago
parent
commit
644f99cc35
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/Database/Query.php

+ 2 - 1
src/Database/Query.php

@@ -29,6 +29,7 @@ use Closure;
 use InvalidArgumentException;
 use IteratorAggregate;
 use RuntimeException;
+use Throwable;
 
 /**
  * This class represents a Relational database SQL Query. A query can be of
@@ -2456,7 +2457,7 @@ class Query implements ExpressionInterface, IteratorAggregate
             );
             $sql = $this->sql();
             $params = $this->getValueBinder()->bindings();
-        } catch (RuntimeException $e) {
+        } catch (Throwable $e) {
             $sql = 'SQL could not be generated for this query as it is incomplete.';
             $params = [];
         } finally {