From bbf5c30b0cb0428ecae15cc12af8c35dd121c2d1 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Mon, 19 Feb 2024 14:22:12 +0000 Subject: [PATCH] core: throw custom value errors from handler --- src/config.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/config.cpp b/src/config.cpp index ca61308..575968d 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -405,8 +405,14 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std:: break; } case CConfigValue::eDataType::CONFIGDATATYPE_CUSTOM: { - reinterpret_cast(VALUEIT->second.m_pData)->handler(value.c_str(), &reinterpret_cast(VALUEIT->second.m_pData)->data); + auto RESULT = reinterpret_cast(VALUEIT->second.m_pData) + ->handler(value.c_str(), &reinterpret_cast(VALUEIT->second.m_pData)->data); reinterpret_cast(VALUEIT->second.m_pData)->lastVal = value; + + if (RESULT.error) { + result.setError(RESULT.getError()); + return result; + } break; } default: {