|
@@ -30,5 +30,25 @@
|
|
return false;\
|
|
return false;\
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* nJson 异常处理的宏,不带返回值 */
|
|
|
|
+#define nJsonCatchNoReturn catch(const nJson::parse_error& e) \
|
|
|
|
+ { \
|
|
|
|
+ SPDLOG_WARN("nJson parse failed: {}", e.what());\
|
|
|
|
+ return;\
|
|
|
|
+ }\
|
|
|
|
+ catch(const nJson::type_error& e) \
|
|
|
|
+ {\
|
|
|
|
+ SPDLOG_WARN("nJson type failed: {}", e.what());\
|
|
|
|
+ return;\
|
|
|
|
+ }catch (const std::exception& e)\
|
|
|
|
+ {\
|
|
|
|
+ SPDLOG_WARN("nJson std failed: {}", e.what());\
|
|
|
|
+ return;\
|
|
|
|
+ }catch(...)\
|
|
|
|
+ {\
|
|
|
|
+ SPDLOG_WARN("nJson Operated failed: unknown error");\
|
|
|
|
+ return;\
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
#endif /* COMMONDEFINE_H */
|
|
#endif /* COMMONDEFINE_H */
|