Refactor handle_revoke_and_ack to wrapper error handling function