How to get an exit code from SystemExit exception 
Author Message
 How to get an exit code from SystemExit exception

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.



Tue, 29 Nov 2005 06:46:13 GMT  
 How to get an exit code from SystemExit exception


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



Tue, 29 Nov 2005 06:57:11 GMT  
 How to get an exit code from SystemExit exception

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.

Quote:
  ----- 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


    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



Tue, 29 Nov 2005 07:12:19 GMT  
 How to get an exit code from SystemExit exception
Hi,

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

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

In 1.8.0, a SystemExit object has "status" method.

                                                        matz.



Tue, 29 Nov 2005 09:35:04 GMT  
 How to get an exit code from SystemExit exception
Thanks, Matz. I am looking forward to a stable release of 1.8,
according to recent posts it may happen any time soon ;-).

Gennady.

Quote:

> Hi,

> In message "[Q] How to get an exit code from SystemExit exception"

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

> In 1.8.0, a SystemExit object has "status" method.

>                                                    matz.



Tue, 29 Nov 2005 14:57:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. SystemExit exception in RubyWin

2. PyErr_Print and SystemExit exceptions

3. Q: Getting exit code from unix script

4. code to exit on Exit ?

5. Exception>>#exit: causes image to freeze

6. exiting a `rescue' without creating an exception

7. semantics of exception when exiting a procedure

8. sys.exit and exceptions (newbie question)

9. Forcing exit(); unqualified exception catchers

10. Non-exiting exceptions

11. tclsh has null pointer exception on exit from console

12. Stopping exception unwinding at exit

 

 
Powered by phpBB® Forum Software