-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathExceptions.h
59 lines (46 loc) · 1.21 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
#ifndef EXCEPTIONS_H__
#define EXCEPTIONS_H__
#include <stdexcept>
#include <cerrno>
#include "Message.h"
namespace FCPLib {
class FCPException : public std::runtime_error {
Message::Ptr message;
public:
FCPException(Message::Ptr m);
const Message::Ptr getMessage() const {
return message;
}
~FCPException() throw();
};
class FCPNodeFailure : public std::runtime_error {
public:
FCPNodeFailure(std::string msg) : std::runtime_error(msg) {}
};
class FileError : public std::runtime_error {
std::string path_;
public:
FileError( std::string msg, std::string path )
: std::runtime_error(msg),
path_(path) {}
const std::string& getFile() const { return path_; }
~FileError() throw() {}
};
class NotImplemented : public std::logic_error {
public:
NotImplemented(std::string msg) : std::logic_error(msg) {}
};
class CommandTimeout : public std::runtime_error {
public:
CommandTimeout(std::string msg) : std::runtime_error(msg) {}
};
class ConnectionRefused : public std::runtime_error {
public:
ConnectionRefused(std::string msg) : std::runtime_error(msg) {}
};
class TestDDAError : public std::runtime_error {
public:
TestDDAError(std::string msg) : std::runtime_error(msg) {}
};
}
#endif