提交 7c278236 编写于 作者: M Megvii Engine Team

feat(core): redact exception messages if logging is disabled

GitOrigin-RevId: 1d6bda2380ca3853ada488236cd81845550e786e
上级 6137adc0
...@@ -84,9 +84,13 @@ void __on_exception_throw__(const std::exception &exc) ...@@ -84,9 +84,13 @@ void __on_exception_throw__(const std::exception &exc)
MGB_CATCH(..., {_stmt; throw; }) \ MGB_CATCH(..., {_stmt; throw; }) \
_stmt _stmt
#if MGB_ENABLE_LOGGING
//! throw exception with given message
#define mgb_throw(_exc, _msg...) mgb_throw_raw(_exc(::mgb::ssprintf(_msg)))
#else
//! throw exception with given message //! throw exception with given message
#define mgb_throw(_exc, _msg...) \ #define mgb_throw(_exc, _msg...) mgb_throw_raw(_exc(""))
mgb_throw_raw(_exc(::mgb::ssprintf(_msg))) \ #endif
//! throw exception with given message if condition is true //! throw exception with given message if condition is true
#define mgb_throw_if(_cond, _exc, _msg...) \ #define mgb_throw_if(_cond, _exc, _msg...) \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册