2013-01-29 04:07:54 +01:00
|
|
|
#ifndef _Error_incl_
|
|
|
|
#define _Error_incl_
|
|
|
|
|
|
|
|
#include <glog/logging.h>
|
|
|
|
#include <stdexcept>
|
|
|
|
|
2013-03-05 07:29:58 +01:00
|
|
|
namespace encfs {
|
|
|
|
|
2013-10-20 00:35:26 +02:00
|
|
|
class Error : public std::runtime_error {
|
|
|
|
public:
|
2013-01-29 04:07:54 +01:00
|
|
|
Error(const char *msg);
|
|
|
|
};
|
|
|
|
|
|
|
|
#define STR(X) #X
|
|
|
|
|
2013-10-20 00:35:26 +02:00
|
|
|
#define rAssert(cond) \
|
|
|
|
do { \
|
|
|
|
if ((cond) == false) { \
|
|
|
|
LOG(ERROR) << "Assert failed: " << STR(cond); \
|
|
|
|
throw Error(STR(cond)); \
|
|
|
|
} \
|
|
|
|
} while (0)
|
2013-01-29 04:07:54 +01:00
|
|
|
|
2013-03-05 07:29:58 +01:00
|
|
|
} // namespace encfs
|
|
|
|
|
2013-01-29 04:07:54 +01:00
|
|
|
#endif
|