From 99f14adcb365e14574430864194e25f2a2f91b24 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 2 Jun 2023 10:08:46 +0800 Subject: [PATCH] update --- core/basic/enum_converter.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; }; };