#include <string>
#include <sstream>
#include <exception>
#include <utility>
#include <openvpn/common/stringize.hpp>
#include <openvpn/common/string.hpp>
Go to the source code of this file.
◆ OPENVPN_EXCEPTION
#define OPENVPN_EXCEPTION |
( |
|
C | ) |
|
Value:
{ \
public: \
{ \
} \
{ \
} \
}
#define OPENVPN_FILE_LINE
Definition at line 100 of file exception.hpp.
◆ OPENVPN_EXCEPTION_INHERIT
#define OPENVPN_EXCEPTION_INHERIT |
( |
|
B, |
|
|
|
C |
|
) |
| |
Value: class C : public B \
{ \
public: \
{ \
} \
{ \
} \
}
Definition at line 144 of file exception.hpp.
◆ OPENVPN_EXCEPTION_WITH_CODE
#define OPENVPN_EXCEPTION_WITH_CODE |
( |
|
C, |
|
|
|
DEFAULT_CODE, |
|
|
|
... |
|
) |
| |
Value: enum C##_##code : unsigned int{__VA_ARGS__}; \
{ \
public: \
{ \
add_label(#DEFAULT_CODE); \
} \
{ \
add_label(#DEFAULT_CODE); \
} \
option_error(C##_##code code, const std::string &err) \
{ \
add_label(code2string(code)); \
} \
static std::string code2string(C##_##code code); \
}
Definition at line 113 of file exception.hpp.
◆ OPENVPN_FILE_LINE
#define OPENVPN_FILE_LINE |
◆ OPENVPN_SIMPLE_EXCEPTION
#define OPENVPN_SIMPLE_EXCEPTION |
( |
|
C | ) |
|
Value: class C : public std::exception \
{ \
public: \
const char *what() const noexcept override \
{ \
} \
}
Definition at line 75 of file exception.hpp.
◆ OPENVPN_SIMPLE_EXCEPTION_INHERIT
#define OPENVPN_SIMPLE_EXCEPTION_INHERIT |
( |
|
B, |
|
|
|
C |
|
) |
| |
Value: class C : public B \
{ \
public: \
{ \
} \
const char *what() const noexcept override \
{ \
} \
}
Definition at line 86 of file exception.hpp.
◆ OPENVPN_THROW
#define OPENVPN_THROW |
( |
|
exc, |
|
|
|
stuff |
|
) |
| |
Value: do \
{ \
std::ostringstream _ovpn_exc; \
_ovpn_exc << stuff; \
throw exc(_ovpn_exc.str()); \
} while (0)
Definition at line 175 of file exception.hpp.
◆ OPENVPN_THROW_ARG1
#define OPENVPN_THROW_ARG1 |
( |
|
exc, |
|
|
|
arg, |
|
|
|
stuff |
|
) |
| |
Value: do \
{ \
std::ostringstream _ovpn_exc; \
_ovpn_exc << stuff; \
throw exc(arg, _ovpn_exc.str()); \
} while (0)
Definition at line 183 of file exception.hpp.
◆ OPENVPN_THROW_EXCEPTION
#define OPENVPN_THROW_EXCEPTION |
( |
|
stuff | ) |
|
Value: do \
{ \
std::ostringstream _ovpn_exc; \
_ovpn_exc << stuff; \
} while (0)
Definition at line 166 of file exception.hpp.
◆ OPENVPN_UNTAGGED_EXCEPTION
#define OPENVPN_UNTAGGED_EXCEPTION |
( |
|
C | ) |
|
Value:
{ \
public: \
C(
const std::string err) :
openvpn::Exception(err) \
{ \
} \
}
Definition at line 134 of file exception.hpp.
◆ OPENVPN_UNTAGGED_EXCEPTION_INHERIT
#define OPENVPN_UNTAGGED_EXCEPTION_INHERIT |
( |
|
B, |
|
|
|
C |
|
) |
| |
Value: class C : public B \
{ \
public: \
using B::B; \
}
Definition at line 158 of file exception.hpp.