libfuoten 0.8.2
Qt based library to access the Nextcloud News App API.
Loading...
Searching...
No Matches
Fuoten::Error Class Reference

Provides information about occurred errors. More...

#include <Fuoten/Error>

Inheritance diagram for Fuoten::Error:
QObject

Public Types

enum  Severity : quint8 { Nothing = 0 , Warning = 1 , Critical = 2 , Fatal = 3 }
 Defines the severity of the error. More...
enum  Type : quint8 {
  NoError = 0 , RequestError = 1 , JSONParsingError = 2 , InputError = 3 ,
  OutputError = 4 , ServerError = 5 , ApplicationError = 6 , StorageError = 7 ,
  AuthorizationError = 8
}
 Defines the error type. More...

Properties

QString data
 Additional error data.
Fuoten::Error::Severity severity
 The severity of the error.
QString text
 Text describing the error in a human readable way.
Fuoten::Error::Type type
 Type of the error.

Public Member Functions

 Error (const QSqlError &sqlError, const QString &errorText=QString(), QObject *parent=nullptr)
 Constructs a new Error object from a QSqlError.
 Error (QJsonParseError jsonError, QObject *parent=nullptr)
 Constructs a new Error object form a QJsonParseError.
 Error (QNetworkReply *reply, QObject *parent=nullptr)
 Constructs a new Error object from a QNetworkReply.
 Error (QObject *parent=nullptr)
 Constructs a new empty Error object.
 Error (Type errorType, Severity errorSeverity, const QString &errorText, const QString &errorData, QObject *parent=nullptr)
 Constructs a new Error object from the given arguments.
 ~Error () override
 Deconstructs the Error object.
QString data () const
 Returns additional error data.
void setData (const QString &nData)
 Sets additional error data.
void setSeverity (Severity nSeverity)
 Sets the error severity.
void setText (const QString &nText)
 Sets the human readable text.
void setType (Type nType)
 Sets the error type.
Severity severity () const
 Returns the error severity.
QString text () const
 Returns the error text.
Type type () const
 Returns the error type.

Signals

void dataChanged (const QString &data)
 This signal is emitted if the additional data changes.
void severityChanged (Fuoten::Error::Severity severity)
 This signal is emitted if the severity changes.
void textChanged (const QString &text)
 This signal is emitted if the error text changes. \ſa text.
void typeChanged (Fuoten::Error::Type type)
 This signal is emitted if the error type changes.

Detailed Description

Provides information about occurred errors.

Member Enumeration Documentation

◆ Severity

enum Fuoten::Error::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 Fuoten::Error::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 Fuoten::Error::data
read

Additional error data.

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

◆ severity

Fuoten::Error::Severity Fuoten::Error::severity
read

The severity of the error.

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

◆ text

QString Fuoten::Error::text
read

Text describing the error in a human readable way.

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

◆ type

Fuoten::Error::Type Fuoten::Error::type
read

Type of the error.

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

Constructor & Destructor Documentation

◆ Error() [1/5]

Error::Error ( QObject * parent = nullptr)
explicit

Constructs a new empty Error object.

◆ Error() [2/5]

Error::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::Error ( QNetworkReply * reply,
QObject * parent = nullptr )
explicit

Constructs a new Error object from a QNetworkReply.

◆ Error() [4/5]

Error::Error ( QJsonParseError jsonError,
QObject * parent = nullptr )

Constructs a new Error object form a QJsonParseError.

◆ Error() [5/5]

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

Constructs a new Error object from a QSqlError.

◆ ~Error()

Error::~Error ( )
override

Deconstructs the Error object.

Member Function Documentation

◆ data()

QString Error::data ( ) const

Returns additional error data.

See also
data

◆ dataChanged

void Fuoten::Error::dataChanged ( const QString & data)
signal

This signal is emitted if the additional data changes.

See also
data

◆ setData()

void Error::setData ( const QString & nData)

Sets additional error data.

See also
data

◆ setSeverity()

void Error::setSeverity ( Severity nSeverity)

Sets the error severity.

See also
severity

◆ setText()

void Error::setText ( const QString & nText)

Sets the human readable text.

See also
text

◆ setType()

void Error::setType ( Type nType)

Sets the error type.

See also
type

◆ severity()

Error::Severity Error::severity ( ) const

Returns the error severity.

See also
severity

◆ severityChanged

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

This signal is emitted if the severity changes.

See also
severity

◆ text()

QString Error::text ( ) const

Returns the error text.

See also
text

◆ textChanged

void Fuoten::Error::textChanged ( const QString & text)
signal

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

◆ type()

Error::Type Error::type ( ) const

Returns the error type.

See also
type

◆ typeChanged

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

This signal is emitted if the error type changes.

See also
type

The documentation for this class was generated from the following files:
  • Fuoten/error.h
  • build/Fuoten/FuotenQt5_autogen/include/moc_error.cpp
  • Fuoten/error.cpp