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