private function SetError($errorMessage = "", $errorNumber = 0)
{
try {
if (strlen($errorMessage) > 0) {
$this->error_desc = $errorMessage;
} else {
if ($this->IsConnected()) {
$this->error_desc = mysqli_error($this->mysql_link);
} else {
$this->error_desc = mysqli_connect_error();
}
}
if ($errorNumber != 0) {
$this->error_number = $errorNumber;
} else {
if ($this->IsConnected()) {
$this->error_number = @mysqli_errno($this->mysql_link);
} else {
$this->error_number = @mysqli_connect_errno();
}
}
} catch (Exception $e) {
$this->error_desc = $e->getMessage();
$this->error_number = -999;
}
if ($this->ThrowExceptions) {
if (isset($this->error_desc) && $this->error_desc != NULL) {
throw new Exception($this->error_desc . ' (' . __LINE__ . ')');
}
}
}