mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 19:29:04 -05:00
Give a better error message when an action GuiPath doesn't start with a '/'
This commit is contained in:
@@ -117,7 +117,11 @@ struct [[codegen::Dictionary(Action)]] Action {
|
||||
a.documentation = action.documentation.value_or(a.documentation);
|
||||
a.guiPath = action.guiPath.value_or(a.guiPath);
|
||||
if (!a.guiPath.starts_with('/')) {
|
||||
throw ghoul::RuntimeError("Action's GuiPath must start with /");
|
||||
throw ghoul::RuntimeError(
|
||||
fmt::format(
|
||||
"Tried to register action: '{}'. The field 'GuiPath' is set to '{}' but "
|
||||
"should be '/{}' ", a.name, a.guiPath, a.guiPath)
|
||||
);
|
||||
}
|
||||
if (action.isLocal.has_value()) {
|
||||
a.isLocal = interaction::Action::IsLocal(*action.isLocal);
|
||||
|
||||
Reference in New Issue
Block a user