소스 검색

[HttpKernel] Throw exception when SQLite statement execution failed

This fixes SQLiteProfilerStorageTest, that was failing using PDO.
ornicar 14 년 전
부모
커밋
80b03f92b3
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/Symfony/Component/HttpKernel/Profiler/SQLiteProfilerStorage.php

+ 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));
+            }
         }
     }