core: throw custom value errors from handler

This commit is contained in:
Vaxry 2024-02-19 14:22:12 +00:00
parent bf5c561905
commit bbf5c30b0c
1 changed files with 7 additions and 1 deletions

View File

@ -405,8 +405,14 @@ CParseResult CConfig::configSetValueSafe(const std::string& command, const std::
break;
}
case CConfigValue::eDataType::CONFIGDATATYPE_CUSTOM: {
reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->handler(value.c_str(), &reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->data);
auto RESULT = reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)
->handler(value.c_str(), &reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->data);
reinterpret_cast<CConfigCustomValueType*>(VALUEIT->second.m_pData)->lastVal = value;
if (RESULT.error) {
result.setError(RESULT.getError());
return result;
}
break;
}
default: {