diff --git a/core/basic/enum_converter.hpp b/core/basic/enum_converter.hpp index eebbf0e..0686e52 100644 --- a/core/basic/enum_converter.hpp +++ b/core/basic/enum_converter.hpp @@ -16,6 +16,8 @@ #include #include +#include "iflytopcpp/core/spdlogfactory/logger.hpp" + namespace iflytop { namespace core { using namespace std; @@ -34,13 +36,14 @@ class EnumConverter { if (it != _str2e.end()) { return it->second; } - return "unkown"; + return fmt::format("unkown({})", (int)e); }; T str2e(string s) { auto it = _e2str.find(s); if (it != _e2str.end()) { return it->second; } + throw std::invalid_argument(fmt::format("EnumConverter unkown convert ({})", s)); return (T)-1; }; };