[Q] How to get an exit code from SystemExit exception

I catch SystemExit exception raised as a result of "exit " somewhere in the code. How do I get the in my rescue?

Gennady.

I catch SystemExit exception raised as a result of "exit " somewhere
in the code. How do I get the in my rescue?

Gennady.

Would that be $?

···

on 6/12/03 6:46 PM, Gennady at gfb@tonesoft.com wrote:


Regards,
JJ

Be Kind, Be Careful, Be Yourself

Hi,

···

In message “[Q] How to get an exit code from SystemExit exception” on 03/06/13, “Gennady” gfb@tonesoft.com writes:

I catch SystemExit exception raised as a result of “exit ” somewhere in the code. How do I get the
in my rescue?

In 1.8.0, a SystemExit object has “status” method.

						matz.

Re: [Q] How to get an exit code from SystemExit exceptionUnfortunatelly, not. $? is “The exit status of the last child process to terminate”. However I tried it anyway, just in desperate hope ;-).

Thank you,
Gennady.

···

----- Original Message -----
From: John Johnson
To: ruby-talk ML
Sent: Thursday, June 12, 2003 3:57 PM
Subject: Re: [Q] How to get an exit code from SystemExit exception

on 6/12/03 6:46 PM, Gennady at gfb@tonesoft.com wrote:

I catch SystemExit exception raised as a result of "exit <status>" somewhere in the code. How do I get the <status> in my rescue?

Gennady.

Would that be $?


Regards,
JJ

Be Kind, Be Careful, Be Yourself

Thanks, Matz. I am looking forward to a stable release of 1.8,
according to recent posts it may happen any time soon ;-).

Gennady.

···

On Thursday, June 12, 2003, at 06:35 PM, Yukihiro Matsumoto wrote:

Hi,

In message “[Q] How to get an exit code from SystemExit exception” > on 03/06/13, “Gennady” gfb@tonesoft.com writes:

I catch SystemExit exception raised as a result of “exit ”
somewhere in the code. How do I get the
in my rescue?

In 1.8.0, a SystemExit object has “status” method.

  					matz.