Re: Exception handling

From: Fons Rademakers (rdm@pcsalo.cern.ch)
Date: Fri Jul 02 1999 - 01:32:30 MEST


Hi George,

   I tried a little while ago to handle exceptions in the ROOT outer loop,
but they never got trapped. Could you maybe have a look at this for me?

See the file BASE_System.cxx in TSystem::Run(). If you compile ROOT with
the flag -DR__EH all exceptions should be caught there, by catch (...).

Cheers, Fons.


> 
> Rooters,
> 
> I observed in the documentation that ROOT/CINT supports exceptions when 
> the exception being thrown is an object type. Fine, I thought, that's 
> really the most useful form of exception anyway, and wrote some 
> Root-based code using them.
> 
> Running the code interactively, I made a mistake and caused an 
> exception to be thrown, which was not caught.  When this happened, the 
> entire ROOT executable terminated.
> 
> This is, I think, not the desired behavior when Root/Cint is being 
> controlled from the command line -- exceptions should probably be 
> caught at the outer loop, any executing macros terminated and the user 
> returned to the command prompt with a message indicating that an 
> uncaught exception was thrown.
> 
> How hard would this be to implement?
> 
> George Heintzelman
> gah@bnl.gov
> 
> 
> 
> 
> 


-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers@cern.ch              Phone: +41 22 7679248
WWW:    http://root.cern.ch/~rdm/            Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:35 MET