8 #define BNB_THROW(exception, message) \
10 const auto er_msg__ = std::string("At ") + __FILE__ + ":" + std::to_string(__LINE__) + ". " + message; \
11 std::fprintf(stderr, "BanubaSDK error: %s\n", er_msg__.c_str()); \
12 throw exception(er_msg__); \
15 #define BNB_THROW_DOMAIN(exception, domain, message) \
17 const auto er_msg__ = std::string("At ") + __FILE__ + ":" + std::to_string(__LINE__) + ". " + message; \
18 std::fprintf(stderr, "BanubaSDK error: %s\n", er_msg__.c_str()); \
19 throw exception(domain, er_msg__); \
27 const char* domain()
const noexcept
29 return m_domain.c_str();
35 : m_domain(std::move(domain))
44 runtime_error(std::string domain, std::string message) noexcept
45 : std::runtime_error(message)
54 logic_error(std::string domain, std::string message) noexcept
55 : std::logic_error(message)
65 std::string domain, std::string message, std::string resource
68 , m_resource(std::move(resource))
72 const char* resource()
const noexcept
74 return m_resource.c_str();
78 std::string m_resource;