-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from dragosprotung/pdo_connection_with_err_mod…
…e_exception Catch PDOExceptions and check error codes
- Loading branch information
Showing
8 changed files
with
162 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
version: '2' | ||
services: | ||
composer: | ||
image: prooph/composer:7.1 | ||
volumes: | ||
- .:/app | ||
links: | ||
- postgres:postgres | ||
- mysql:mysql | ||
|
||
postgres: | ||
image: postgres:alpine | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
- POSTGRES_DB=snapshot_tests | ||
|
||
mysql: | ||
image: mysql | ||
ports: | ||
- 3306:3306 | ||
environment: | ||
- MYSQL_ROOT_PASSWORD= | ||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes | ||
- MYSQL_DATABASE=snapshot_tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* This file is part of the prooph/pdo-snapshot-store. | ||
* (c) 2016-2017 prooph software GmbH <contact@prooph.de> | ||
* (c) 2016-2017 Sascha-Oliver Prolic <saschaprolic@googlemail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Prooph\SnapshotStore\Pdo\Exception; | ||
|
||
use RuntimeException as PHPRuntimeException; | ||
|
||
class RuntimeException extends PHPRuntimeException | ||
{ | ||
public static function fromStatementErrorInfo(array $errorInfo): RuntimeException | ||
{ | ||
return new self( | ||
sprintf( | ||
"Error %s. \nError-Info: %s", | ||
$errorInfo[0], | ||
$errorInfo[2] | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters