MediaWiki  master
DBTransactionError.php
Go to the documentation of this file.
1 <?php
20 namespace Wikimedia\Rdbms;
21 
22 use Wikimedia\NormalizedException\INormalizedException;
23 use Wikimedia\NormalizedException\NormalizedExceptionTrait;
24 
30 class DBTransactionError extends DBExpectedError implements INormalizedException {
31 
32  use NormalizedExceptionTrait;
33 
42  public function __construct(
43  ?IDatabase $db, $error, array $params = [], \Throwable $prev = null, $errorParams = []
44  ) {
45  $this->normalizedMessage = $error;
46  $this->messageContext = $errorParams;
47  parent::__construct(
48  $db,
49  self::getMessageFromNormalizedMessage( $error, $params ),
50  $params,
51  $prev
52  );
53  }
54 }
55 
59 class_alias( DBTransactionError::class, 'DBTransactionError' );
IDatabase null $db
Definition: DBError.php:33
Base class for the more common types of database errors.
string[] $params
Message parameters.
__construct(?IDatabase $db, $error, array $params=[], \Throwable $prev=null, $errorParams=[])
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:39