This repository was archived by the owner on Aug 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +57
-0
lines changed
Expand file tree Collapse file tree 4 files changed +57
-0
lines changed Original file line number Diff line number Diff line change 1+ #pragma once
2+ #ifndef mirai_cpp_exceptions_exceptions_hpp_H_
3+ #define mirai_cpp_exceptions_exceptions_hpp_H_
4+
5+ #include " mirai_api_http_exception.hpp"
6+ #include " network_exception.hpp"
7+
8+ #endif // !mirai_cpp_exceptions_exceptions_hpp_H_
Original file line number Diff line number Diff line change 1+ #pragma once
2+ #ifndef mirai_cpp_exceptions_mirai_api_http_exception_hpp_H_
3+ #define mirai_cpp_exceptions_mirai_api_http_exception_hpp_H_
4+
5+ #include < exception>
6+ #include < string>
7+
8+ namespace Cyan
9+ {
10+ /* *
11+ * @brief mirai-api-http 异常
12+ */
13+ class MiraiApiHttpException : public std ::runtime_error
14+ {
15+ public:
16+ const int Code;
17+ const string Message;
18+ MiraiApiHttpException (int code, const std::string& error_msg) :
19+ Code (code),
20+ Message (error_msg),
21+ std::runtime_error (" mirai-api-http 错误: " + error_msg) {}
22+ virtual ~MiraiApiHttpException () = default ;
23+ };
24+
25+ }
26+
27+ #endif // !mirai_cpp_exceptions_mirai_api_http_exception_hpp_H_
Original file line number Diff line number Diff line change 1+ #pragma once
2+ #ifndef mirai_cpp_exceptions_network_exception_hpp_H_
3+ #define mirai_cpp_exceptions_network_exception_hpp_H_
4+
5+ #include < exception>
6+
7+ namespace Cyan
8+ {
9+ /* *
10+ * @brief 网络错误异常
11+ */
12+ class NetworkException : public std ::runtime_error
13+ {
14+ public:
15+ NetworkException (): std::runtime_error(" 网络错误." ) {}
16+ virtual ~NetworkException () = default ;
17+ };
18+
19+ }
20+
21+ #endif // !mirai_cpp_exceptions_network_exception_hpp_H_
Original file line number Diff line number Diff line change 44
55#include "mirai/defs/defs.hpp"
66#include "mirai/events/events.hpp"
7+ #include "mirai/exceptions/exceptions.hpp"
78#include "mirai/mirai_bot.hpp"
89
910#endif // !mirai_cpp__mirai_h_H_
You can’t perform that action at this time.
0 commit comments