QtSparql  0.2.6
Public Types | Public Member Functions | List of all members
QSparqlError Class Reference

The QSparqlError class provides SPARQL error information. More...

Public Types

enum  ErrorType {
  NoError, ConnectionError, StatementError, TransactionError,
  BackendError, UnknownError
}
 

Public Member Functions

 QSparqlError (const QString &message=QString(), ErrorType type=NoError, int number=-1)
 
 QSparqlError (const QSparqlError &other)
 
QSparqlErroroperator= (const QSparqlError &other)
 
 ~QSparqlError ()
 
QString message () const
 
void setMessage (const QString &message)
 
ErrorType type () const
 
void setType (ErrorType type)
 
int number () const
 
void setNumber (int number)
 
bool isValid () const
 

Detailed Description

The QSparqlError class provides SPARQL error information.

A QSparqlError object can provide driver-specific error data, including the error message(), number() and type(). The functions all have setters so that you can create and return QSparqlError objects from your own classes, for example from your own SPARQL drivers.

See also
QSparqlConnection::lastError(), QSparqlResult::lastError()

Member Enumeration Documentation

◆ ErrorType

This enum type describes the context in which the error occurred.

Enumerator
NoError 

No error occurred.

ConnectionError 

Connection error.

StatementError 

SPARQL statement syntax error.

TransactionError 

Transaction failed error.

BackendError 

Other backend-specific error

UnknownError 

Unknown error.

Constructor & Destructor Documentation

◆ QSparqlError() [1/2]

QSparqlError::QSparqlError ( const QString &  message = QString(),
ErrorType  type = NoError,
int  number = -1 
)

Constructs an error containing the driver error message, the type type and the optional error number number.

◆ QSparqlError() [2/2]

QSparqlError::QSparqlError ( const QSparqlError other)

Creates a copy of other.

◆ ~QSparqlError()

QSparqlError::~QSparqlError ( )

Destroys the object and frees any allocated resources.

Member Function Documentation

◆ isValid()

bool QSparqlError::isValid ( ) const

Returns true if an error is set, otherwise false.

See also
type()

◆ message()

QString QSparqlError::message ( ) const

Returns the error message.

See also
setMessage()

◆ number()

int QSparqlError::number ( ) const

Returns the connection-specific error number, or -1 if it cannot be determined.

See also
setNumber()

◆ operator=()

QSparqlError & QSparqlError::operator= ( const QSparqlError other)

Assigns the other error's values to this error.

◆ setMessage()

void QSparqlError::setMessage ( const QString &  message)

Sets the error message to the value of message.

See also
message()

◆ setNumber()

void QSparqlError::setNumber ( int  number)

Sets the connection-specific error number to number.

See also
number()

◆ setType()

void QSparqlError::setType ( ErrorType  type)

Sets the error type to the value of type.

See also
type()

◆ type()

QSparqlError::ErrorType QSparqlError::type ( ) const

Returns the error type, or -1 if the type cannot be determined.

See also
setType()

The documentation for this class was generated from the following files: