MediaWiki REL1_30
DBQueryError.php
Go to the documentation of this file.
1<?php
22namespace Wikimedia\Rdbms;
23
29 public $error;
31 public $errno;
33 public $sql;
35 public $fname;
36
44 public function __construct( IDatabase $db, $error, $errno, $sql, $fname ) {
45 if ( $db instanceof Database && $db->wasConnectionError( $errno ) ) {
46 $message = "A connection error occured. \n" .
47 "Query: $sql\n" .
48 "Function: $fname\n" .
49 "Error: $errno $error\n";
50 } else {
51 $message = "A database query error has occurred. Did you forget to run " .
52 "your application's database schema updater after upgrading? \n" .
53 "Query: $sql\n" .
54 "Function: $fname\n" .
55 "Error: $errno $error\n";
56 }
57
58 parent::__construct( $db, $message );
59
60 $this->error = $error;
61 $this->errno = $errno;
62 $this->sql = $sql;
63 $this->fname = $fname;
64 }
65}
66
67class_alias( DBQueryError::class, 'DBQueryError' );
IDatabase null $db
Definition DBError.php:32
Base class for the more common types of database errors.
__construct(IDatabase $db, $error, $errno, $sql, $fname)
Relational database abstraction object.
Definition Database.php:45
Basic database interface for live and lazy-loaded relation database handles.
Definition IDatabase.php:40