Skip to content

Commit bbf5c30

Browse files
committed
core: throw custom value errors from handler
1 parent bf5c561 commit bbf5c30

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/config.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,14 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std::
405405
break;
406406
}
407407
case CConfigValue::eDataType::CONFIGDATATYPE_CUSTOM: {
408-
reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->handler(value.c_str(), &reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->data);
408+
auto RESULT = reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)
409+
->handler(value.c_str(), &reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->data);
409410
reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->lastVal = value;
411+
412+
if (RESULT.error) {
413+
result.setError(RESULT.getError());
414+
return result;
415+
}
410416
break;
411417
}
412418
default: {

0 commit comments

Comments
 (0)