@@ -269,7 +269,6 @@ public function transactionStart() {
269
269
270
270
/**
271
271
* @return $this
272
- * @throws \Exception
273
272
*/
274
273
public function transactionCommit () {
275
274
return $ this ->transactionEnd (function () {
@@ -279,7 +278,6 @@ public function transactionCommit() {
279
278
280
279
/**
281
280
* @return $this
282
- * @throws \Exception
283
281
*/
284
282
public function transactionRollback () {
285
283
return $ this ->transactionEnd (function () {
@@ -290,8 +288,6 @@ public function transactionRollback() {
290
288
/**
291
289
* @param callable|null $callback
292
290
* @return mixed
293
- * @throws \Exception
294
- * @throws \Error
295
291
*/
296
292
public function dryRun ($ callback = null ) {
297
293
$ result = null ;
@@ -302,10 +298,10 @@ public function dryRun($callback = null) {
302
298
$ this ->transactionRollback ();
303
299
} catch (\Exception $ e ) {
304
300
$ this ->transactionRollback ();
305
- throw $ e ;
301
+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
306
302
} catch (\Error $ e ) {
307
303
$ this ->transactionRollback ();
308
- throw $ e ;
304
+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
309
305
}
310
306
} else {
311
307
$ uniqueId = $ this ->genUniqueId ();
@@ -315,10 +311,10 @@ public function dryRun($callback = null) {
315
311
$ this ->exec ("ROLLBACK TO {$ uniqueId }" );
316
312
} catch (\Exception $ e ) {
317
313
$ this ->exec ("ROLLBACK TO {$ uniqueId }" );
318
- throw $ e ;
314
+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
319
315
} catch (\Error $ e ) {
320
316
$ this ->exec ("ROLLBACK TO {$ uniqueId }" );
321
- throw $ e ;
317
+ throw new RuntimeException ( $ e -> getMessage (), ( int ) $ e -> getCode (), $ e ) ;
322
318
}
323
319
}
324
320
return $ result ;
@@ -328,8 +324,6 @@ public function dryRun($callback = null) {
328
324
* @param int|callable $tries
329
325
* @param callable|null $callback
330
326
* @return mixed
331
- * @throws \Exception
332
- * @throws \Error
333
327
*/
334
328
public function transaction ($ tries = 1 , $ callback = null ) {
335
329
if (is_callable ($ tries )) {
@@ -371,7 +365,7 @@ public function transaction($tries = 1, $callback = null) {
371
365
}
372
366
}
373
367
if ($ exception !== null ) {
374
- throw $ exception ;
368
+ throw new RuntimeException ( $ exception-> getMessage (), ( int ) $ exception -> getCode (), $ exception ) ;
375
369
}
376
370
return $ result ;
377
371
}
0 commit comments