| PST SDK 6.0.0.0-272350a

TrackerExceptions.h
Go to the documentation of this file.
1 // Copyright PS-Tech B.V. All Rights Reserved.
2
3 #ifndef TRACKER_EXCEPTIONS_H
4 #define TRACKER_EXCEPTIONS_H
5
6 #include "PstBase.h"
7 #include <stdexcept>
8
9 namespace PSTech
10 {
20 class PST_EXPORT PSTException
21 {
22 public:
23 explicit PSTException(const char* what);
24 PSTException(const PSTException& other);
25 PSTException(PSTException&& other) noexcept;
26 PSTException(const char* function, int line, const char* what);
27 virtual ~PSTException();
28 virtual const char* what() const;
29 virtual const char* where() const;
30 virtual const char* full_description() const;
32 private:
33 char* m_what;
34 char* m_where;
35 char* m_full;
36 };
37
41 #define DECLARE_PST_EXCEPTION( child, parent ) \
42 class child : public parent \
43 { \
44 public: \
45 explicit child(const char* what) : parent(what) {} \
46 child(const char* function, int line, const char* what) : parent(function, line, what) {}\
47 }
48
49 DECLARE_PST_EXCEPTION(TrackerException, PSTException);
50 DECLARE_PST_EXCEPTION(InvalidDataException, TrackerException);
51 DECLARE_PST_EXCEPTION(NotFoundException, TrackerException);
52 DECLARE_PST_EXCEPTION(AlreadyExistsException, TrackerException);
53 DECLARE_PST_EXCEPTION(IOException, TrackerException);
54 DECLARE_PST_EXCEPTION(OutOfRangeException, TrackerException);
55 DECLARE_PST_EXCEPTION(NotSupportedException, TrackerException);
56 DECLARE_PST_EXCEPTION(NotInitializedException, TrackerException);
57 DECLARE_PST_EXCEPTION(HttpException, TrackerException);
58 DECLARE_PST_EXCEPTION(JSONException, TrackerException);
59 }
60 #endif //TRACKER_EXCEPTIONS_H
PSTech
Definition: ExportedTypeConversions.h:8
PSTech::OutOfRangeException
Definition: TrackerExceptions.h:54
PSTech::HttpException
Definition: TrackerExceptions.h:57
PSTech::NotInitializedException
Definition: TrackerExceptions.h:56
PSTech::TrackerException
Definition: TrackerExceptions.h:49
PSTech::PSTException::m_what
char * m_what
Definition: TrackerExceptions.h:33
PST_EXPORT
#define PST_EXPORT
Definition: PstBase.h:12
DECLARE_PST_EXCEPTION
#define DECLARE_PST_EXCEPTION(child, parent)
Definition: TrackerExceptions.h:41
PSTech::PSTException::m_where
char * m_where
Definition: TrackerExceptions.h:34
PSTech::NotSupportedException
Definition: TrackerExceptions.h:55
PSTech::JSONException
Definition: TrackerExceptions.h:58
PSTech::AlreadyExistsException
Definition: TrackerExceptions.h:52
PSTech::NotFoundException
Definition: TrackerExceptions.h:51
PSTech::PSTException::m_full
char * m_full
Definition: TrackerExceptions.h:35
PSTech::InvalidDataException
Definition: TrackerExceptions.h:50
PSTech::PSTException
Generic tracker exception.
Definition: TrackerExceptions.h:20
PSTech::IOException
Definition: TrackerExceptions.h:53
PstBase.h