Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
DBTransactionError
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 8
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * @license GPL-2.0-or-later
4 * @file
5 */
6namespace Wikimedia\Rdbms;
7
8use Wikimedia\NormalizedException\INormalizedException;
9use Wikimedia\NormalizedException\NormalizedExceptionTrait;
10
11/**
12 * @newable
13 * @ingroup Database
14 */
15class DBTransactionError extends DBExpectedError implements INormalizedException {
16
17    use NormalizedExceptionTrait;
18
19    /**
20     * @stable to call
21     * @param IDatabase|null $db
22     * @param string $error
23     * @param array $params parameters to be passed down to the i18n message
24     * @param \Throwable|null $prev
25     * @param array $errorParams PSR-3 message context
26     */
27    public function __construct(
28        ?IDatabase $db, $error, array $params = [], ?\Throwable $prev = null, $errorParams = []
29    ) {
30        $this->normalizedMessage = $error;
31        $this->messageContext = $errorParams;
32        parent::__construct(
33            $db,
34            self::getMessageFromNormalizedMessage( $error, $params ),
35            $params,
36            $prev
37        );
38    }
39}