forked from infinispan/cpp-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
exceptions.h
73 lines (56 loc) · 1.7 KB
/
exceptions.h
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef ISPN_HOTROD_EXCEPTIONS_H
#define ISPN_HOTROD_EXCEPTIONS_H
#include "infinispan/hotrod/ImportExport.h"
#include <exception>
#include <string>
namespace infinispan {
namespace hotrod {
class HR_EXTERN Exception : public std::exception
{
public:
explicit Exception(const std::string& message=std::string()) throw();
virtual ~Exception() throw();
virtual const char* what() const throw();
private:
const std::string message;
};
// Matching the names of the Java exceptions where possible, adding if
// necessary.
struct HR_EXTERN HotRodClientException : public Exception
{
HotRodClientException(const std::string&);
//virtual ~HotRodClientException() throw();
};
struct HR_EXTERN TransportException : public HotRodClientException
{
std::string host;
int port;
TransportException(const std::string& host, int port,
const std::string&);
~TransportException() throw();
const std::string& getHost() const;
int getPort() const;
};
struct HR_EXTERN InvalidResponseException : public HotRodClientException
{
InvalidResponseException(const std::string&);
};
struct HR_EXTERN RemoteNodeSuspectException : public HotRodClientException
{
RemoteNodeSuspectException(const std::string&);
};
struct HR_EXTERN InternalException : public HotRodClientException
{
InternalException(const std::string&);
};
struct HR_EXTERN RemoteCacheManagerNotStartedException : public HotRodClientException
{
RemoteCacheManagerNotStartedException(const std::string&);
};
// not existent in java code
struct HR_EXTERN RemoteCacheNotExistException : public HotRodClientException
{
RemoteCacheNotExistException(const std::string&);
};
}} // namespace
#endif /* ISPN_HOTROD_EXCEPTIONS_H */