MediaWiki  master
DBQueryError.php
Go to the documentation of this file.
1 <?php
22 namespace Wikimedia\Rdbms;
23 
31  public $error;
33  public $errno;
35  public $sql;
37  public $fname;
38 
48  public function __construct( IDatabase $db, $error, $errno, $sql, $fname, $message = null ) {
49  if ( $message === null ) {
50  $message = "Error $errno: $error\n" .
51  "Function: $fname\n" .
52  "Query: $sql\n";
53  }
54 
55  parent::__construct( $db, $message, [ 'dbName' => $db->getServerName() ] );
56 
57  $this->error = $error;
58  $this->errno = $errno;
59  $this->sql = $sql;
60  $this->fname = $fname;
61  }
62 }
63 
67 class_alias( DBQueryError::class, 'DBQueryError' );
IDatabase null $db
Definition: DBError.php:34
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:39
getServerName()
Get the readable name for the server.