CernVM-FS  2.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
exception.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_UTIL_EXCEPTION_H_
6 #define CVMFS_UTIL_EXCEPTION_H_
7 
8 #include <stdexcept>
9 #include <string>
10 
11 #include "logging.h"
12 
13 #ifdef CVMFS_NAMESPACE_GUARD
14 namespace CVMFS_NAMESPACE_GUARD {
15 #endif
16 
17 class ECvmfsException : public std::runtime_error {
18  public:
19  explicit ECvmfsException(const std::string& what_arg)
20  : std::runtime_error(what_arg) {}
21 };
22 
23 #define CVMFS_S1(x) #x
24 #define CVMFS_S2(x) CVMFS_S1(x)
25 #define CVMFS_SOURCE_LOCATION "PANIC: " __FILE__ " : " CVMFS_S2(__LINE__)
26 #define PANIC(...) Panic(CVMFS_SOURCE_LOCATION, kLogCvmfs, __VA_ARGS__);
27 
28 __attribute__((noreturn))
29 void Panic(const char *coordinates, const LogSource source, const int mask,
30  const char *format, ...);
31 
32 // For PANIC(NULL)
33 __attribute__((noreturn))
34 void Panic(const char *coordinates, const LogSource source, const char *nul);
35 
36 #ifdef CVMFS_NAMESPACE_GUARD
37 } // namespace CVMFS_NAMESPACE_GUARD
38 #endif
39 
40 #endif // CVMFS_UTIL_EXCEPTION_H_
void Panic(const char *coordinates, const LogSource source, const int mask, const char *format,...)
Definition: exception.cc:19
struct cvmcache_object_info __attribute__
Definition: atomic.h:24
LogSource
ECvmfsException(const std::string &what_arg)
Definition: exception.h:19