Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef PRAD_EXCEPTION_H
#define PRAD_EXCEPTION_H
#include <stdlib.h>
#include <string.h>
#include <exception>
#include <string>
#include <sstream>
class PRadException : public std::exception
{
public:
enum PRadExceptionType
{
UNKNOWN_ERROR,
ET_CONNECT_ERROR,
ET_CONFIG_ERROR,
ET_STATION_CONFIG_ERROR,
ET_STATION_CREATE_ERROR,
ET_STATION_ATTACH_ERROR,
ET_READ_ERROR,
ET_PUT_ERROR,
HIGH_VOLTAGE_ERROR,
};
PRadException(const std::string &typ, const std::string &txt = "", const std::string &aux = "");
PRadException(PRadExceptionType typ = UNKNOWN_ERROR, const std::string &txt = "", const std::string &aux = "");
PRadException(PRadExceptionType typ, const std::string &txt, const std::string &file, const std::string &func, int line);
virtual ~PRadException(void) {}
virtual std::string FailureDesc(void) const;
virtual std::string FailureType(void) const;
const char *what() const noexcept;
public:
PRadExceptionType type; // exception type
std::string title;
std::string text; // primary text
std::string auxText; // auxiliary text
};
#endif