# IR -e not returning error codes properly

**URL:** <https://www.ruby-forum.com/t/ir-e-not-returning-error-codes-properly/176324>\
**Category:** IronRuby\
**Created:** [September 29, 2009, 5:41am UTC](https://www.ruby-forum.com/t/ir-e-not-returning-error-codes-properly/176324 "2009-09-29T05:41:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xerxes\_Battiwalla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/d9b06d/32.png) [@Xerxes\_Battiwalla](https://www.ruby-forum.com/u/Xerxes_Battiwalla)\
**Post date:** [September 29, 2009, 5:41am UTC](https://www.ruby-forum.com/t/ir-e-not-returning-error-codes-properly/176324/1 "2009-09-29T05:41:57Z")

</div>

This problem manifests itself when running rspec tests under IronRuby  
(through our Rakefile), and I think i’ve found a simple reproduction  
of the issue using the following command-line sequence.

## MRI does this:

D:\>ruby -e ‘exit(777)’  
D:\>echo %errorlevel%  
777

## IR does this:

D:\>ir -e ‘exit(666)’  
D:\>echo %errorlevel%  
0

I’ve tried this against the current HEAD (03054a5be81), and it fails.  
You guys happy for me to log this in CodePlex? Is there any possible  
work-around in the meantime, as our RSpec rake tasks are passing when  
they should fail.

Cheers,  
Xerx.

---

<div class="post-metadata">

**Author:** ![Xerxes\_Battiwalla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/d9b06d/32.png) [@Xerxes\_Battiwalla](https://www.ruby-forum.com/u/Xerxes_Battiwalla)\
**Post date:** [September 29, 2009, 6:27am UTC](https://www.ruby-forum.com/t/ir-e-not-returning-error-codes-properly/176324/2 "2009-09-29T06:27:02Z")

</div>

Not repro’ing here. Can you recompile from VS just to check? If it still  
happens, contact me offlist and I’ll get those binaries and see if I can  
repro with your bits.

JD
