Add iferr commands to get stack before exit on error.