mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-24 15:25:59 +01:00
config: throw an error explicitly when parsing colors in gradients
ref #8552
This commit is contained in:
parent
54f57797e9
commit
55ec8bd512
1 changed files with 4 additions and 1 deletions
|
@ -67,7 +67,10 @@ static Hyprlang::CParseResult configHandleGradientSet(const char* VALUE, void**
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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) {
|
} catch (std::exception& e) {
|
||||||
Debug::log(WARN, "Error parsing gradient {}", V);
|
Debug::log(WARN, "Error parsing gradient {}", V);
|
||||||
parseError = "Error parsing gradient " + V + ": " + e.what();
|
parseError = "Error parsing gradient " + V + ": " + e.what();
|
||||||
|
|
Loading…
Reference in a new issue