Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| DBConnectionError | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * @license GPL-2.0-or-later |
| 4 | * @file |
| 5 | */ |
| 6 | namespace Wikimedia\Rdbms; |
| 7 | |
| 8 | /** |
| 9 | * @newable |
| 10 | * @ingroup Database |
| 11 | */ |
| 12 | class DBConnectionError extends DBExpectedError { |
| 13 | /** |
| 14 | * @stable to call |
| 15 | * @param IDatabase|null $db Object throwing the error |
| 16 | * @param string $error Error text |
| 17 | */ |
| 18 | public function __construct( ?IDatabase $db = null, $error = 'unknown error' ) { |
| 19 | $msg = 'Cannot access the database'; |
| 20 | if ( trim( $error ) != '' ) { |
| 21 | $msg .= ": $error"; |
| 22 | } |
| 23 | |
| 24 | parent::__construct( $db, $msg ); |
| 25 | } |
| 26 | } |