Exemple #1
0
 /**
  * @param IDatabase $db
  * @param string $error
  * @param int|string $errno
  * @param string $sql
  * @param string $fname
  */
 function __construct(IDatabase $db, $error, $errno, $sql, $fname)
 {
     if ($db instanceof Database && $db->wasConnectionError($errno)) {
         $message = "A connection error occured. \n" . "Query: {$sql}\n" . "Function: {$fname}\n" . "Error: {$errno} {$error}\n";
     } else {
         $message = "A database query error has occurred. Did you forget to run " . "your application's database schema updater after upgrading? \n" . "Query: {$sql}\n" . "Function: {$fname}\n" . "Error: {$errno} {$error}\n";
     }
     parent::__construct($db, $message);
     $this->error = $error;
     $this->errno = $errno;
     $this->sql = $sql;
     $this->fname = $fname;
 }