Ver Fonte

[HttpKernel] Throw exception when SQLite statement execution failed

This fixes SQLiteProfilerStorageTest, that was failing using PDO.
ornicar há 14 anos atrás
pai
commit
80b03f92b3

+ 4 - 1
src/Symfony/Component/HttpKernel/Profiler/SQLiteProfilerStorage.php

@@ -157,7 +157,10 @@ class SQLiteProfilerStorage implements ProfilerStorageInterface
             foreach ($args as $arg => $val) {
                 $stmt->bindValue($arg, $val, is_int($val) ? \PDO::PARAM_INT : \PDO::PARAM_STR);
             }
-            $stmt->execute();
+            $success = $stmt->execute();
+            if (!$success) {
+                throw new \RuntimeException(sprintf('Error executing SQLite query "%s"', $query));
+            }
         }
     }