1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2024-11-18 13:55:11 -05:00
polybar/include/exception.hpp
2016-05-24 04:00:43 +02:00

20 lines
531 B
C++

#ifndef _EXCEPTION_HPP_
#define _EXCEPTION_HPP_
#include <string>
#include <stdexcept>
struct Exception : public std::runtime_error
{
Exception(std::string const &error_message = "")
: std::runtime_error(error_message.c_str()) {}
};
#define DefineChildException(ExName, ParentEx) struct ExName : public ParentEx { \
ExName(std::string error_message = "") \
: ParentEx("["+ std::string(__FUNCTION__) +"] => "+ error_message) {} \
}
#define DefineBaseException(ExName) DefineChildException(ExName, Exception)
#endif