/*	Returns: the last error message from previous database operation
Note: This function is NOT available for Microsoft SQL Server.
340959
function ErrorMsg()
	{
		if ($this->_logsql) return $this->_errorMsg;
		if (function_exists('sybase_get_last_message'))
			$this->_errorMsg = sybase_get_last_message();
		else
			$this->_errorMsg = isset($php_errormsg) ? $php_errormsg : 'SYBASE error messages not supported on this platform';
		return $this->_errorMsg;
	}
1336959
private function errorCode()
    {
        if ($this->preparedExec == false){
    		$returnValue = $this->dbConnector->errorCode();
    	}
    	else{
    		$returnValue = $this->lastPreparedExecStatement->errorCode();
    	}
        return (string) $returnValue;
    }
321314
public function getLastError(): string
    {
        if ($this->isConnected() && $this->socket) {
            $err = @socket_last_error($this->socket);
            if ($err) {
                $err = socket_strerror($err);
            }
            if (!$err) {
                $err = 'Unknown error';
            }
            return $err;
        } else {
            return 'Not connected';
        }
    }
352468
def check_last_err(func, self, *args, **kwargs):
    

    if self._last_err is not None:
        try:
            if six.PY2:
                six.reraise(type(self._last_err), self._last_err,
                            self._last_tb)
            else:
                # NB(directxman12): not using six.reraise in Python 3 leads
                #                   to cleaner tracebacks, and raise x is valid
                #                   syntax in Python 3 (unlike raise x, y, z)
                raise self._last_err
        finally:
            if six.PY2:
                del self._last_tb  # in case of cycles, break glass

            self._last_err = None
    else:
        return func(self, *args, **kwargs)

    @deco.decorator
    def check_last_err(func, self, *args, **kwargs):
        if self._last_err is not None:
            try:
                raise self._last_err
            finally:
                self._last_err = None
        else:
            return func(self, *args, **kwargs)
181075
public function getLastErrorResponse() {
        if (!empty($this->rawResponses)) {
            foreach (array_reverse($this->rawResponses) as $x) {
                if (isset($x['error'])) {
                    return $x;
                }
            }
        }
    }
196235
def _extract_msg_from_last_exception():
    '''  '''
    last_exc_type, last_error, last_traceback = sys.exc_info()
    if isinstance(last_error, exceptions.DXAPIError):
        # Using the same code path as below would not
        # produce a useful message when the error contains a
        # 'details' hash (which would have a last line of
        # '}')
        return last_error.error_message()
    else:
        return traceback.format_exc().splitlines()[-1].strip()
851798
function ErrorMsg()
	{
		if (!$this->_connectionID) return "No connection established";
		$errc = $this->_connectionID->Errors;
		if (!$errc) return "No Errors object found";
		if ($errc->Count == 0) return '';
		$err = $errc->Item($errc->Count-1);
		return $err->Description;
	}
883309
final public static function fromLastError()
    {
        $error = error_get_last();
        if ($error !== null) {
            return new ErrorException($error['message'], 0, $error['type'], $error['file'], $error['line']);
        }
    }
964736
public function getSQLDetailedErrorMessage()
    {
        return sprintf(
            "«%s»\n%s\n(%s)",
            pg_result_error_field($this->result_resource, \PGSQL_DIAG_MESSAGE_PRIMARY),
            pg_result_error_field($this->result_resource, \PGSQL_DIAG_MESSAGE_DETAIL),
            pg_result_error_field($this->result_resource, \PGSQL_DIAG_MESSAGE_HINT)
        );
    }
64915
protected int getLastOrderNumber() throws RepositoryException
   {
      checkIfOpened();
      try
      {
         ResultSet count = findLastOrderNumber(1, true);
         try
         {
            if (count.next())
            {
               return count.getInt(1) - 1;
            }
            else
            {
               return -1;
            }
         }
         finally
         {
            try
            {
               count.close();
            }
            catch (SQLException e)
            {
               LOG.error("Can't close the ResultSet: " + e.getMessage());
            }
         }
      }
      catch (SQLException e)
      {
         throw new RepositoryException(e);
      }
   }
1100573
public function getLastError() {

		if(true === $this -> connection instanceof \mysqli) {
			$this -> connect();
		}

		return $this -> connection -> error;
	}
205224
public Object getLastModified(int iHandleType) throws DBException, RemoteException
    {
        m_objCurrentPhysicalRecord = NONE;
        m_objCurrentCacheRecord = NONE;
        return m_tableRemote.getLastModified(iHandleType);
    }
1005091
static public function lastPregErrorMessage()
    {
        $error = preg_last_error();
        $errorType = 'PCRE Engine error';

        switch ($error) {

            case PREG_BACKTRACK_LIMIT_ERROR:
                $errorType = "PCRE Engine backtrack limit exceeded";
                break;

            case PREG_RECURSION_LIMIT_ERROR:
                $errorType = "PCRE Engine recursion limit exceeded";
                break;

            case PREG_BAD_UTF8_ERROR:case PREG_BAD_UTF8_OFFSET_ERROR:
                $errorType = "PCRE Engine malformed UTF-8 error";
                break;
        }
        
        return $errorType;
    }
173547
public function lastError($db, $cb, $params = [], $conn = null)
    {
        $e = explode('.', $db, 2);
        $params['getlasterror'] = 1;
        $cb = CallbackWrapper::wrap($cb);
        try {
            $this->request(
                self::OP_QUERY,
                pack('V', 0) . $e[0] . '.$cmd' . "\x00"
                . pack('VV', 0, -1) . bson_encode($params),
                true,
                $conn,
                function ($conn, $reqId = null) use ($db, $cb) {
                    if (!$conn) {
                        !$cb || $cb(['$err' => 'Connection error.']);
                        return;
                    }
                    $conn->requests[$reqId] = [$db, $cb, true];
                }
            );
        } catch (\MongoException $e) {
            Daemon::log('MongoClient exception: ' . $e->getMessage() . ': ' . $e->getTraceAsString());
            if ($cb !== null) {
                $cb(['$err' => $e->getMessage()]);
            }
        }
    }
880419
public function get_last_error() {
        $error = false;
        // First look for any previously saved stmt error
        if (!empty($this->last_stmt_error)) {
            $error = $this->last_stmt_error;
            $this->last_stmt_error = null;
        } else { // Now try connection error
            $e = oci_error($this->oci);
            if ($e !== false) {
                $error = $e['message'];
            }
        }
        return $error;
    }
15642
function Error($err,$fn)
	{
	global $_ADODB_ACTIVE_DBS;

		$fn = get_class($this).'::'.$fn;
		$this->_lasterr = $fn.': '.$err;

		if ($this->_dbat < 0) {
			$db = false;
		}
		else {
			$activedb = $_ADODB_ACTIVE_DBS[$this->_dbat];
			$db = $activedb->db;
		}

		if (function_exists('adodb_throw')) {
			if (!$db) {
				adodb_throw('ADOdb_Active_Record', $fn, -1, $err, 0, 0, false);
			}
			else {
				adodb_throw($db->databaseType, $fn, -1, $err, 0, 0, $db);
			}
		} else {
			if (!$db || $db->debug) {
				ADOConnection::outp($this->_lasterr);
			}
		}

	}
150560
def __last_error(namespace, args):
    
    cmd = SON([("getlasterror", 1)])
    cmd.update(args)
    splitns = namespace.split('.', 1)
    return query(0, splitns[0] + '.$cmd', 0, -1, cmd,
                 None, DEFAULT_CODEC_OPTIONS)