MediaWiki master
DBTransactionError.php
Go to the documentation of this file.
1<?php
20namespace Wikimedia\Rdbms;
21
22use Wikimedia\NormalizedException\INormalizedException;
23use Wikimedia\NormalizedException\NormalizedExceptionTrait;
24
29class DBTransactionError extends DBExpectedError implements INormalizedException {
30
31 use NormalizedExceptionTrait;
32
41 public function __construct(
42 ?IDatabase $db, $error, array $params = [], \Throwable $prev = null, $errorParams = []
43 ) {
44 $this->normalizedMessage = $error;
45 $this->messageContext = $errorParams;
46 parent::__construct(
47 $db,
48 self::getMessageFromNormalizedMessage( $error, $params ),
49 $params,
50 $prev
51 );
52 }
53}
54
58class_alias( DBTransactionError::class, 'DBTransactionError' );
IDatabase null $db
Definition DBError.php:38
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:36