Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > stop and display traceback when thread throws an exception

Reply
Thread Tools

stop and display traceback when thread throws an exception

 
 
Ralph Shnelvar
Guest
Posts: n/a
 
      09-22-2010
[Note: parts of this message were removed to make it a legal post.]

Is there a way to stop all threads and display traceback when any thread (especially a thread that is not the main thread) throws an exception?
 
Reply With Quote
 
 
 
 
Quintus
Guest
Posts: n/a
 
      09-22-2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 22.09.2010 04:24, schrieb Ralph Shnelvar:
> Is there a way to stop all threads and display traceback when any thread (especially a thread that is not the main thread) throws an exception?


You can either run ruby with the -d (or --debug) switch or call this
somewhere in your code:

Thread.abort_on_exception = true

Vale,
Quintus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkyZtOQACgkQDYShvwAbcNmA6wCgiwr/HXLnEKqYB33KRW7qlz7U
oPIAn3aUa9O+EQi/7XyiATJHO/F2RdvK
=aPOP
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
elise huard
Guest
Posts: n/a
 
      09-22-2010
in my experience the ruby-debug debugger (1.8.7) goes all haywire when
you're working with threads.

On Wed, Sep 22, 2010 at 9:48 AM, Quintus <(E-Mail Removed)> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Am 22.09.2010 04:24, schrieb Ralph Shnelvar:
>> Is there a way to stop all threads and display traceback when any thread (especially a thread that is not the main thread) throws an exception?

>
> You can either run ruby with the -d (or --debug) switch or call this
> somewhere in your code:
>
> Thread.abort_on_exception = true
>
> Vale,
> Quintus
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkyZtOQACgkQDYShvwAbcNmA6wCgiwr/HXLnEKqYB33KRW7qlz7U
> oPIAn3aUa9O+EQi/7XyiATJHO/F2RdvK
> =aPOP
> -----END PGP SIGNATURE-----
>
>


 
Reply With Quote
 
Ralph Shnelvar
Guest
Posts: n/a
 
      09-22-2010
[Note: parts of this message were removed to make it a legal post.]

Quintus,

Wednesday, September 22, 2010, 1:48:58 AM, you wrote:

Q> -----BEGIN PGP SIGNED MESSAGE-----
Q> Hash: SHA1

Q> Am 22.09.2010 04:24, schrieb Ralph Shnelvar:
>> Is there a way to stop all threads and display traceback when any thread (especially a thread that is not the main thread) throws an exception?


Q> You can either run ruby with the -d (or --debug) switch or call this
Q> somewhere in your code:

Q> Thread.abort_on_exception = true

Q> Vale,
Q> Quintus

That was exactly what I was looking for. Thank you!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"raise (type, value, traceback)" and "raise type, value, traceback" Jack Bates Python 0 05-02-2011 05:23 PM
Appending traceback from exception in child thread Edd Python 4 05-16-2009 09:43 AM
Is an exception specification needed if the method throws and catchesits own exception? elcapitan666@gmail.com C++ 2 11-27-2007 04:01 AM
wlanapi.dll throws exception in rpc thread joshl@purenetworks.com Wireless Networking 0 12-07-2006 12:13 AM
Exception Exception is not compatible with throws clause in Runnable.run() Chris Miller Java 4 11-22-2003 03:11 PM



Advertisments