rabin 3 周之前
父節點
當前提交
22a7252738
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/Dever/App.php

+ 3 - 1
src/Dever/App.php

@@ -100,7 +100,9 @@ class App
                 $db->commit();
                 return $data;
             } catch (\Exception $e) {
-                $db->rollback();
+                if ($db->inTransaction()) {
+                    $db->rollback();
+                }
                 $data = $e->getTrace();
                 Dever::get(Debug::class)->trace($data);
                 throw new \Exception(json_encode($data));