QEverCloud
Unofficial Evernote Cloud API for Qt
|
EverCloudException counterpart for asynchronous API. More...
Inherits QObject.
Inherited by qevercloud::EvernoteExceptionData, and qevercloud::ThriftExceptionData.
Public Member Functions | |
EverCloudExceptionData (QString err) | |
virtual void | throwException () const |
If you want to throw an exception that corresponds to a recrived EverCloudExceptionData descendant than call this function. More... | |
Public Attributes | |
QString | errorMessage |
Contains an error message. More... | |
EverCloudException counterpart for asynchronous API.
Asynchronous functions cannot throw exceptions so descendants of EverCloudExceptionData are retunded instead in case of an error. Every exception class has its own counterpart. The EverCloudExceptionData descendants hierarchy is a copy of the EverCloudException descendants hierarchy.
The main reason not to use exception classes directly is that dynamic_cast does not work across module (exe, dll, etc) boundaries in general, while qobject_cast
do work as expected. That's why I decided to inherit my error classes from QObject.
In general error checking in asynchronous API look like this:
Note the handling of the EDAMSystemExceptionRateLimitReached
and EDAMSystemExceptionAuthExpired
cases. They should be handled for any Evernote API function call in a special way.
|
inlinevirtual |
If you want to throw an exception that corresponds to a recrived EverCloudExceptionData descendant than call this function.
Do not use throw
statement, it's not polymorphic.
Reimplemented in qevercloud::EDAMSystemExceptionAuthExpiredData, qevercloud::EvernoteExceptionData, qevercloud::EDAMSystemExceptionRateLimitReachedData, qevercloud::EDAMNotFoundExceptionData, qevercloud::EDAMSystemExceptionData, qevercloud::EDAMUserExceptionData, and qevercloud::ThriftExceptionData.
QString qevercloud::EverCloudExceptionData::errorMessage |
Contains an error message.
It's the std::exception::what() counterpart.