Beaucoup de personnes se plaignent du surplus de fonctionnalités dans zsh (on en connaît même qui considère l'historique comme une fonctionnalité trop évoluée). Pour leur faire plaisir, un patch a été écrit par un des auteurs du shell pour ajouter le principe des exceptions disponibles en Python, Java, etc.
La syntaxe est la suivante :
:try
# Code here runs normally
:always
# Code here always gets run, even if there is a fatal
# error (unless it crashes the shell), or a return, break,
# or continue in the :try block.
#
# Optionally:
unset -e
# removes any error condition. Apart from that, after exiting
# the always block, the logic is as if it hadn't been present.
:tried