Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Use of { try-list } always { always-list } with "set e-"
- X-seq: zsh-users 26788
- From: Zach Riggle <zachriggle@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Use of { try-list } always { always-list } with "set e-"
- Date: Sat, 17 Jul 2021 08:03:44 -0500
- Archived-at: <https://zsh.org/users/26788>
- List-id: <zsh-users.zsh.org>
Hello all!
I'm trying to use the "always" keyword to ensure that some cleanup
happens, even if an error occurs.
Perhaps I'm misunderstanding the intent of this feature, but it seems
that the always-list should be executed, even with "set -e".
===================
set -e
() {
{
echo TRY
false
} always {
echo ALWAYS
}
}
===================
I know that the always-list is executed if there's a "return" or
"exit" statement in the try-list, but I was hoping to be able to put
in some cleanup in the always-list in the event of an error.
Is there any way to achieve what I'm looking to do?
Zach Riggle
Messages sorted by:
Reverse Date,
Date,
Thread,
Author