Changeset 72:fc91522ef9be in SMSSender for lib/libdatatypes/src/exceptions/eexception.h


Ignore:
Timestamp:
Feb 9, 2010 9:47:21 PM (10 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
3.0
Convert:
svn:3639001d-8e34-449c-bb86-3782b86c4877/branches/3.0@71
Message:
  • Started exception handling
  • Fixed several bugs from the removal of the iloginaccount gateway
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/libdatatypes/src/exceptions/eexception.h

    r71 r72  
    99#define EEXCEPTION_H_
    1010
    11 #include <stdexcept>
     11#include <QList>
     12#include <QMap>
    1213#include <QString>
     14#include <QStringList>
    1315
    14 class EException: public std::runtime_error {
     16class EException {
    1517public:
    16     explicit EException(const QString& msg) : std::runtime_error(msg.toStdString()) {}
     18    EException()
     19        : chainedException_(NULL)
     20    {};
     21    explicit EException(const QString& msg);
     22    ~EException() throw(){};
     23
     24    EException      addDebugInfo(const QString& value) throw();
     25    EException      addDebugInfo(const QString& key, int value) throw();
     26    EException      addDebugInfo(const QString& key, const QString& value) throw();
     27    EException      addDebugInfos(const QList<QString>& debugInfos) throw();
     28    EException      addDebugInfos(const QMap<QString, QString>& debugInfos) throw();
     29    QList<QString>  debugInfos() const throw();
     30
     31    EException      chain(const EException& exception) throw();
     32    EException      chainedException() const throw();
     33
     34    void            setMessage(const QString& msg) throw();
     35    QString         what(bool chained = true) const throw();
     36    QString         chainedWhat() const throw();
     37    QString         unchainedWhat() const throw();
     38    virtual QString toString() const throw();
     39
     40private:
     41    QString         message_;
     42    QStringList     debugInfos_;
     43    EException*     chainedException_;
    1744};
    1845
Note: See TracChangeset for help on using the changeset viewer.