Go to the documentation of this file.00001
00004 #ifndef BPSEXCEPTION_H
00005 #define BPSEXCEPTION_H
00006
00007 #include "bpscore_global.h"
00008 #include <QString>
00009 #include <QScriptValue>
00010
00011 class QScriptContext;
00012
00030 class BPSCORE_EXPORT BpsException
00031 {
00032 BPS_PRIVATE(BpsException)
00033
00034 public:
00035
00039 BpsException();
00040
00045 BpsException(const BpsException& aException);
00046
00064 BpsException(const QString& aFilename, quint32 aLinenumber, const QString& aFunction, const QString& aMessage);
00065
00071 BpsException(const QScriptValue& aException, const QString& aFilename = QString());
00072
00073 virtual ~BpsException();
00074
00080 BpsException& setMessage(const QString& aMessage);
00081
00087 BpsException& appendMessage(const QString& aText);
00088
00114 BpsException& addLocation(const QString& aFilename, quint32 aLinenumber, const QString& aFunction);
00115
00120 QString message() const;
00121
00149 QString text() const;
00150
00177 QScriptValue throwScriptError(QScriptContext* aContext) const;
00178
00179 };
00180
00185 #define bpsMakeException(msg) BpsException(__FILE__, __LINE__, bStr(__FUNCTION__), msg)
00186
00191 #define bpsTraceException(exc) exc.addLocation(__FILE__, __LINE__, bStr(__FUNCTION__))
00192
00193 #endif // BPSEXCEPTION_H