# ERRORLEVEL not set correctly on exception

**URL:** <https://www.ruby-forum.com/t/errorlevel-not-set-correctly-on-exception/68051>\
**Category:** Ruby\
**Created:** [September 8, 2006, 7:22pm UTC](https://www.ruby-forum.com/t/errorlevel-not-set-correctly-on-exception/68051 "2006-09-08T19:22:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 8, 2006, 7:22pm UTC](https://www.ruby-forum.com/t/errorlevel-not-set-correctly-on-exception/68051/1 "2006-09-08T19:22:42Z")

</div>

Hi

If I run the following code, then the DOS ERRORLEVEL is set to 1 as  
expected.

Timeout.timeout(1) { sleep(5) }

If I run the following code, then the DOS ERRORLEVEL is also set to 1 as  
expected.

require ‘test/unit’

class some\_Test \< Test::Unit::TestCase

def test\_something  
assert(false, “Failure”)  
end

end

If I run the following code, then the DOS ERRORLEVEL is set to 0.

require ‘test/unit’

class some\_Test \< Test::Unit::TestCase

def test\_something  
Timeout.timeout(1) { sleep(5) }  
end

end

Shouldn’t the DOS ERRORLEVEL be 1 in the above case? Is this a bug or am  
I  
missing something?

Thanks

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 10, 2006, 1:36pm UTC](https://www.ruby-forum.com/t/errorlevel-not-set-correctly-on-exception/68051/2 "2006-09-10T13:36:39Z")

</div>

Hi,

At Sat, 9 Sep 2006 02:03:51 +0900,  
removed\_email\_address@domain.invalid wrote in [ruby-talk:213402]:

> end
> 
> Shouldn’t the DOS ERRORLEVEL be 1 in the above case? Is this a bug or am I  
> missing something?

Timeout::Error wasn’t caught. It was fixed yesterday.
