@@ -269,7 +269,6 @@ public function transactionStart() {
269269
270270 /**
271271 * @return $this
272- * @throws \Exception
273272 */
274273 public function transactionCommit () {
275274 return $ this ->transactionEnd (function () {
@@ -279,7 +278,6 @@ public function transactionCommit() {
279278
280279 /**
281280 * @return $this
282- * @throws \Exception
283281 */
284282 public function transactionRollback () {
285283 return $ this ->transactionEnd (function () {
@@ -290,8 +288,6 @@ public function transactionRollback() {
290288 /**
291289 * @param callable|null $callback
292290 * @return mixed
293- * @throws \Exception
294- * @throws \Error
295291 */
296292 public function dryRun ($ callback = null ) {
297293 $ result = null ;
@@ -302,10 +298,10 @@ public function dryRun($callback = null) {
302298 $ this ->transactionRollback ();
303299 } catch (\Exception $ e ) {
304300 $ this ->transactionRollback ();
305- throw $ e ;
301+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
306302 } catch (\Error $ e ) {
307303 $ this ->transactionRollback ();
308- throw $ e ;
304+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
309305 }
310306 } else {
311307 $ uniqueId = $ this ->genUniqueId ();
@@ -315,10 +311,10 @@ public function dryRun($callback = null) {
315311 $ this ->exec ("ROLLBACK TO {$ uniqueId }" );
316312 } catch (\Exception $ e ) {
317313 $ this ->exec ("ROLLBACK TO {$ uniqueId }" );
318- throw $ e ;
314+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
319315 } catch (\Error $ e ) {
320316 $ this ->exec ("ROLLBACK TO {$ uniqueId }" );
321- throw $ e ;
317+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
322318 }
323319 }
324320 return $ result ;
@@ -328,8 +324,6 @@ public function dryRun($callback = null) {
328324 * @param int|callable $tries
329325 * @param callable|null $callback
330326 * @return mixed
331- * @throws \Exception
332- * @throws \Error
333327 */
334328 public function transaction ($ tries = 1 , $ callback = null ) {
335329 if (is_callable ($ tries )) {
@@ -371,7 +365,7 @@ public function transaction($tries = 1, $callback = null) {
371365 }
372366 }
373367 if ($ exception !== null ) {
374- throw $ exception ;
368+ throw new RuntimeException ( $ exception-> getMessage (), ( int ) $ exception -> getCode (), $ exception ) ;
375369 }
376370 return $ result ;
377371 }
0 commit comments