@@ -60,9 +60,12 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | public function affectedRows() : int |
| 62 | 62 | { |
| 63 | - try { |
|
| 63 | + try |
|
| 64 | + { |
|
| 64 | 65 | return $this->result->rowCount(); |
| 65 | - } catch( \PDOException $e ) { |
|
| 66 | + } |
|
| 67 | + catch( \PDOException $e ) |
|
| 68 | + { |
|
| 66 | 69 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() ); |
| 67 | 70 | } |
| 68 | 71 | } |
@@ -71,9 +71,12 @@ |
||
| 71 | 71 | */ |
| 72 | 72 | public function execute() : \Aimeos\Base\DB\Result\Iface |
| 73 | 73 | { |
| 74 | - try { |
|
| 74 | + try |
|
| 75 | + { |
|
| 75 | 76 | $result = $this->exec(); |
| 76 | - } catch( \PDOException $e ) { |
|
| 77 | + } |
|
| 78 | + catch( \PDOException $e ) |
|
| 79 | + { |
|
| 77 | 80 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . json_encode( array_column( $this->binds, 0 ) ), $e->getCode() ); |
| 78 | 81 | } |
| 79 | 82 | |
@@ -69,9 +69,12 @@ |
||
| 69 | 69 | */ |
| 70 | 70 | public function execute() : \Aimeos\Base\DB\Result\Iface |
| 71 | 71 | { |
| 72 | - try { |
|
| 72 | + try |
|
| 73 | + { |
|
| 73 | 74 | $result = $this->getConnection()->getRawObject()->getNativeConnection()->query( $this->sql ); |
| 74 | - } catch( \PDOException $e ) { |
|
| 75 | + } |
|
| 76 | + catch( \PDOException $e ) |
|
| 77 | + { |
|
| 75 | 78 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
| 76 | 79 | } |
| 77 | 80 | |