libfuoten 0.8.1
Qt based library to access the ownCloud/Nextcloud News App API
Loading...
Searching...
No Matches
Error Class Reference

#include <Fuoten/Error>

Public Types

enum  Severity : quint8 { Nothing = 0 , Warning = 1 , Critical = 2 , Fatal = 3 }
enum  Type : quint8 {
  NoError = 0 , RequestError = 1 , JSONParsingError = 2 , InputError = 3 ,
  OutputError = 4 , ServerError = 5 , ApplicationError = 6 , StorageError = 7 ,
  AuthorizationError = 8
}

Properties

QString data
Fuoten::Error::Severity severity
QString text
Fuoten::Error::Type type

Public Member Functions

 Error (const QSqlError &sqlError, const QString &errorText=QString(), QObject *parent=nullptr)
 Error (QJsonParseError jsonError, QObject *parent=nullptr)
 Error (QNetworkReply *reply, QObject *parent=nullptr)
 Error (QObject *parent=nullptr)
 Error (Type errorType, Severity errorSeverity, const QString &errorText, const QString &errorData, QObject *parent=nullptr)
 ~Error () override
QString data () const
void setData (const QString &nData)
void setSeverity (Severity nSeverity)
void setText (const QString &nText)
void setType (Type nType)
Severity severity () const
QString text () const
Type type () const

Signals

void dataChanged (const QString &data)
void severityChanged (Fuoten::Error::Severity severity)
void textChanged (const QString &text)
void typeChanged (Fuoten::Error::Type type)

Detailed Description

Provides information about occurred errors.

Member Enumeration Documentation

◆ Severity

enum Severity : quint8

Defines the severity of the error.

Enumerator
Nothing 

No error has occurred

Warning 

Only a warning, but operation was perfmormed

Critical 

A critical error has occurred, the operation has been canceled

Fatal 

A fatal error has occurred, the application will be exited

◆ Type

enum Type : quint8

Defines the error type.

Enumerator
NoError 

No error has occurred.

RequestError 

The request was not setup correctly.

JSONParsingError 

Failed to parse JSON data.

InputError 

An error occurred while providing data to the library methods.

OutputError 

An error occurred while processing the returned data from the API.

ServerError 

An error occurred on the server.

ApplicationError 

An error occurred in the local application.

StorageError 

An error occurred on the storage layer.

AuthorizationError 

Authentication credentials missing or not valid.

Property Documentation

◆ data

QString data
read

Additional error data.

Access functions:
QStringdata() const
Notifier signal:
voiddataChanged(const QString &data)

◆ severity

Fuoten::Error::Severity severity
read

The severity of the error.

Access functions:
Severityseverity() const
Notifier signal:
voidseverityChanged(Severity severity)

◆ text

QString text
read

Text describing the error in a human readable way.

Access functions:
QStringtext() const
Notifier signal:
voidtextChanged(const QString &text)

◆ type

Type of the error.

Access functions:
Typetype() const
Notifier signal:
voidtypeChanged(Type type)

Constructor & Destructor Documentation

◆ Error() [1/5]

Error ( QObject * parent = nullptr)
explicit

Constructs a new empty Error object.

◆ Error() [2/5]

Error ( Type errorType,
Severity errorSeverity,
const QString & errorText,
const QString & errorData,
QObject * parent = nullptr )

Constructs a new Error object from the given arguments.

◆ Error() [3/5]

Error ( QNetworkReply * reply,
QObject * parent = nullptr )
explicit

Constructs a new Error object from a QNetworkReply.

◆ Error() [4/5]

Error ( QJsonParseError jsonError,
QObject * parent = nullptr )

Constructs a new Error object form a QJsonParseError.

◆ Error() [5/5]

Error ( const QSqlError & sqlError,
const QString & errorText = QString(),
QObject * parent = nullptr )

Constructs a new Error object from a QSqlError.

◆ ~Error()

~Error ( )
override

Deconstructs the Error object.

Member Function Documentation

◆ data()

QString data ( ) const

Returns additional error data.

See also
data

◆ dataChanged

void dataChanged ( const QString & data)
signal

This signal is emitted if the additional data changes.

See also
data

◆ setData()

void setData ( const QString & nData)

Sets additional error data.

See also
data

◆ setSeverity()

void setSeverity ( Severity nSeverity)

Sets the error severity.

See also
severity

◆ setText()

void setText ( const QString & nText)

Sets the human readable text.

See also
text

◆ setType()

void setType ( Type nType)

Sets the error type.

See also
type

◆ severity()

Error::Severity severity ( ) const

Returns the error severity.

See also
severity

◆ severityChanged

void severityChanged ( Fuoten::Error::Severity severity)
signal

This signal is emitted if the severity changes.

See also
severity

◆ text()

QString text ( ) const

Returns the error text.

See also
text

◆ textChanged

void textChanged ( const QString & text)
signal

This signal is emitted if the error text changes. \ſa text.

◆ type()

Error::Type type ( ) const

Returns the error type.

See also
type

◆ typeChanged

void typeChanged ( Fuoten::Error::Type type)
signal

This signal is emitted if the error type changes.

See also
type