Skip to content

Commit

Permalink
core: throw custom value errors from handler
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Feb 19, 2024
1 parent bf5c561 commit bbf5c30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit bbf5c30

Please sign in to comment.