# Stop on error?

**URL:** <https://mworks.discourse.group/t/stop-on-error/375>\
**Category:** Support\
**Created:** [September 6, 2017, 3:11pm UTC](https://mworks.discourse.group/t/stop-on-error/375 "2017-09-06T15:11:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 6, 2017, 3:11pm UTC](https://mworks.discourse.group/t/stop-on-error/375/1 "2017-09-06T15:11:01Z")

</div>

Hi Chris,

I noticed today that several MWorks errors don’t stop the experiment. In particular, if I try to index past the end of a sequence, or index an integer, it shows an ERROR in the console but the expt continues with bad values.

We want to be sure to notice and fix any errors, so stopping the experiment is what we want. (An equal alternative would be sounding a siren or vibrating the floor. Stopping is easier).

I vaguely remember there might be a setting for this. If there’s not, can you add one? That would also remove the need to stick stop\_on\_failure=‘YES’ to every run\_python call we make.

Thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 7, 2017, 7:26pm UTC](https://mworks.discourse.group/t/stop-on-error/375/2 "2017-09-07T19:26:35Z")

</div>

Hi Mark,

There’s not a setting for this, but I can add one. It’ll probably be a new system variable ( `#stopOnError`).

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 7, 2017, 9:35pm UTC](https://mworks.discourse.group/t/stop-on-error/375/3 "2017-09-07T21:35:56Z")

</div>

Sounds great. That means we can set it in XML? Do we use a variable with name=“#stopOnError” default value = “yes”, or just use an assignment on every trial?  
Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 11, 2017, 3:08pm UTC](https://mworks.discourse.group/t/stop-on-error/375/4 "2017-09-11T15:08:58Z")

</div>

> That means we can set it in XML? Do we use a variable with name=“#stopOnError” default value = “yes”, or just use an assignment on every trial?

My thought was to make it like any other [configuration variable](https://mworks.discourse.group/kb/installation/configuring-mworks), meaning you would set it either via MWServer’s preferences window or by editing `setup_variables.xml` directly. You could also set it per-experiment by including a `variable_assignments` section in your XML.

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [September 11, 2017, 6:13pm UTC](https://mworks.discourse.group/t/stop-on-error/375/5 "2017-09-11T18:13:18Z")

</div>

Great - having a preference setting for it on MWServer would be good.

thanks,  
Mark

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 18, 2017, 2:20pm UTC](https://mworks.discourse.group/t/stop-on-error/375/6 "2017-10-18T14:20:25Z")

</div>

Hi Mark,

`#stopOnError` and the associated MWServer preference are now in the nightly build.

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 9:52pm UTC](https://mworks.discourse.group/t/stop-on-error/375/7 "2022-07-19T21:52:16Z")

</div>


