|
firfuorida 0.0.1
Qt based database migration library
|
Provides error information. More...
#include <Firfuorida/Error>
Public Types | |
| enum | ErrorType : uint8_t { NoError = 0 , SqlError = 1 , FileSystemError = 2 , InternalError = 3 , UnknownError = 255 } |
| This enum type describes the context in which the error occurred. More... | |
Public Member Functions | |
| Error () | |
| Constructs a new Error object of type NoError. | |
| Error (const Error &other) | |
| Constructs a copy of other. | |
| Error (const QSqlError &sqlError, const QString &text) | |
| Constucts a new Error object with given sqlError and text. | |
| Error (Error &&other) noexcept | |
| Move-constructs an Error instance, making it point at the same object that other was pointing to. | |
| Error (ErrorType type, const QString &text) | |
| Constructs a new Error object with given type and text. | |
| ~Error () | |
| Deconstructs the Error object. | |
| bool | operator!= (const Error &other) const noexcept |
Returns true if this and other have not the same content; otherwise returns false. | |
| Error & | operator= (const Error &other) |
| Assigns other to this Error and returns a reference to this instance. | |
| Error & | operator= (Error &&other) noexcept |
| Move-assigns other to this Error instance. | |
| bool | operator== (const Error &other) const noexcept |
Returns true if this and other have the same content; otherwise returns false. | |
| QSqlError | sqlError () const |
| Returns the QSqlError object if this error is of type SqlError. | |
| void | swap (Error &other) noexcept |
| Swaps this Error instance with other. | |
| QString | text () const |
| Returns the error text. | |
| ErrorType | type () const |
| Returns the type of this error. | |
Related Symbols | |
(Note that these are not member symbols.) | |
| FIRFUORIDA_EXPORT QDebug | operator<< (QDebug dbg, const Firfuorida::Error &error) |
| Writes the text() of error to the dbg stream and returns the stream. | |
Provides error information.
The Error class provides information about occured errors. Use type() to check if an error has occure. text() will return the error text. If the error is an SqlError, there will also be a valid QSqlError returned by sqlError().
| enum Firfuorida::Error::ErrorType : uint8_t |
This enum type describes the context in which the error occurred.
| Enumerator | |
|---|---|
| NoError | No error occured. |
| SqlError | A SQL error occured, sqlError() will return a valid QSqlError object. |
| FileSystemError | A filesystem error occured. |
| InternalError | An internal error occured. |
| UnknownError | An unknown error occured. |
| Error::Error | ( | ) |
Constructs a new Error object of type NoError.
Constructs a new Error object with given type and text.
Constucts a new Error object with given sqlError and text.
The type() will automatically set to SqlError.
|
default |
Constructs a copy of other.
|
defaultnoexcept |
Move-constructs an Error instance, making it point at the same object that other was pointing to.
|
default |
Deconstructs the Error object.
|
inlinenoexcept |
Returns true if this and other have not the same content; otherwise returns false.
Assigns other to this Error and returns a reference to this instance.
Move-assigns other to this Error instance.
|
noexcept |
Returns true if this and other have the same content; otherwise returns false.
|
noexcept |
Swaps this Error instance with other.
| QString Error::text | ( | ) | const |
Returns the error text.
If error is of type() SqlError, the text will also contain the text returned by QSqlError::text();
| Error::ErrorType Error::type | ( | ) | const |
Returns the type of this error.
|
Writes the text() of error to the dbg stream and returns the stream.