# Error handling in do..until loops

**URL:** <https://forum.ansible.com/t/error-handling-in-do-until-loops/18544>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [June 19, 2015, 12:07am UTC](https://forum.ansible.com/t/error-handling-in-do-until-loops/18544 "2015-06-19T00:07:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trond\_Hindenes](https://avatars.discourse-cdn.com/v4/letter/t/96bed5/32.png) [@Trond\_Hindenes](https://forum.ansible.com/u/Trond_Hindenes)\
**Post date:** [June 19, 2015, 12:07am UTC](https://forum.ansible.com/t/error-handling-in-do-until-loops/18544/1 "2015-06-19T00:07:03Z")

</div>

Hi all,  
I’m trying to write a play I’m going to use as part of a windows system reboot “role”. I plan to ping the Windows node’s WinRM port using curl until it’s responding.

If the system is down, the curl command will result in an error (exit code 7).

Here’s my play:
