fix: surface macro parse errors on top-level invocation
An invalid installed macro invoked as a top-level command fell through to the generic unknown-command error, while .macro <name> reported the parse/validation failure. Both paths now surface the reason.
This commit is contained in:
@@ -1337,6 +1337,9 @@ pub async fn run_repl_command(
|
|||||||
"Macro '{name}' is restricted by {} enabled_macros",
|
"Macro '{name}' is restricted by {} enabled_macros",
|
||||||
ctx.macro_lock_owner(*level)
|
ctx.macro_lock_owner(*level)
|
||||||
),
|
),
|
||||||
|
Some(MacroState::Invalid { reason }) => {
|
||||||
|
bail!("Macro '{name}' is invalid: {reason}")
|
||||||
|
}
|
||||||
_ => unknown_command()?,
|
_ => unknown_command()?,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user