sql = is_array($p1) ? $p1[0] : $p1; $this->params = $p2; $s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")"; break; case 'PCONNECT': case 'CONNECT': $user = $thisConnection->user; $s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)"; break; default: //Prevent PHP warning if $p1 or $p2 are arrays. $p1 = ( is_array($p1) ) ? 'Array' : $p1; $p2 = ( is_array($p2) ) ? 'Array' : $p2; $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)"; break; } $this->dbms = $dbms; if ($thisConnection) { $this->host = $thisConnection->host; $this->database = $thisConnection->database; } $this->fn = $fn; $this->msg = $errmsg; if (!is_numeric($errno)) $errno = -1; parent::__construct($s,$errno); } } /** * Default Error Handler. * * @param string $dbms the RDBMS you are connecting to * @param string $fn the name of the calling function (in uppercase) * @param int $errno the native error number from the database * @param string $errmsg the native error msg from the database * @param mixed $p1 $fn specific parameter - see below * @param mixed $p2 $fn specific parameter - see below */ function adodb_throw($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection) { global $ADODB_EXCEPTION; // Do not throw if errors are suppressed by @ operator // error_reporting() value for suppressed errors changed in PHP 8.0.0 $suppressed = version_compare(PHP_VERSION, '8.0.0', '<') ? 0 : E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR | E_PARSE; if (error_reporting() == $suppressed) { return; } $errfn = is_string($ADODB_EXCEPTION) ? $ADODB_EXCEPTION : 'ADODB_EXCEPTION'; throw new $errfn($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection); }