I want to stop the zsh script running when it encounters a command not found error.
I know of
command_not_found_handler, but this function only allows me to print a message, not halt the parent shell.
The functionality I am looking for is similar to when a glob match fails:
echo nonexistent* echo this will not be shown
zsh: no matches found: nonexistent*