mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-11-28 22:50:20 +03:00
config: throw an error explicitly when parsing colors in gradients
ref #8552
This commit is contained in:
parent
54f57797e9
commit
55ec8bd512
@ -67,7 +67,10 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
|
||||
}
|
||||
|
||||
try {
|
||||
DATA->m_vColors.push_back(CColor(*configStringToInt(var)));
|
||||
const auto COL = configStringToInt(var);
|
||||
if (!COL)
|
||||
throw std::runtime_error(std::format("failed to parse {} as a color", var));
|
||||
DATA->m_vColors.push_back(CColor(COL.value()));
|
||||
} catch (std::exception& e) {
|
||||
Debug::log(WARN, "Error parsing gradient {}", V);
|
||||
parseError = "Error parsing gradient " + V + ": " + e.what();
|
||||
|
Loading…
Reference in New Issue
Block a user