16#ifndef MIRAI_EXCEPTIONS_HPP_
17#define MIRAI_EXCEPTIONS_HPP_
44#define REGISTER_STATUS_CODE(name, code) \
45 class name : public MiraiApiHttpException \
48 name(std::string& message) : MiraiApiHttpException(code, message) {} \
73#undef REGISTER_STATUS_CODE
125 :
std::runtime_error(
"Expecting type " + expected +
", but get " + received +
" instead")
139 using std::runtime_error::runtime_error;
#define REGISTER_STATUS_CODE(name, code)
MiraiApiHttpException(int code, std::string message)
NetworkException(int code, std::string message)
ParseError(std::string error, std::string message)
std::string message
原被解析消息
std::string received_type
实际类型
std::string expected_type
目标类型
TypeDismatchError(std::string expected, std::string received)
std::string to_string(EventTypes type)