diff --git a/src/Pdo/PdoTrait.php b/src/Pdo/PdoTrait.php index 376bcbd..1c56c92 100644 --- a/src/Pdo/PdoTrait.php +++ b/src/Pdo/PdoTrait.php @@ -49,8 +49,8 @@ trait PdoTrait } } catch(\PDOException $pdo) { - if (!str_starts_with($pdo->getMessage(), 'There is no active transaction')) { - throw $pdo; + if ( !str_starts_with($pdo->getMessage(), 'There is no active transaction') ) { + throw new \PdoException($pdo->getMessage() . " `$sql` with data:" . json_encode($parameters), (int) $pdo->getCode(), $pdo); } } catch (\Throwable $e) {