Add versions with exceptions

Add versions of commands which execute IO () actions on exceptions.