MediaWiki  master
DBQueryError.php
Go to the documentation of this file.
1 <?php
20 namespace Wikimedia\Rdbms;
21 
29  public $error;
31  public $errno;
33  public $sql;
35  public $fname;
36 
46  public function __construct( IDatabase $db, $error, $errno, $sql, $fname, $message = null ) {
47  if ( $message === null ) {
48  $message = "Error $errno: $error\n" .
49  "Function: $fname\n" .
50  "Query: $sql\n";
51  }
52 
53  parent::__construct( $db, $message, [ 'dbName' => $db->getServerName() ] );
54 
55  $this->error = $error;
56  $this->errno = $errno;
57  $this->sql = $sql;
58  $this->fname = $fname;
59  }
60 }
61 
65 class_alias( DBQueryError::class, 'DBQueryError' );
IDatabase null $db
Definition: DBError.php:33
Base class for the more common types of database errors.
__construct(IDatabase $db, $error, $errno, $sql, $fname, $message=null)
Basic database interface for live and lazy-loaded relation database handles.
Definition: IDatabase.php:40
getServerName()
Get the readable name for the server.