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