Re:Does ROOT handles C++ exceptions

From: Masaharu Goto (MXJ02154@nifty.ne.jp)
Date: Mon Jul 20 1998 - 08:35:00 MEST


Konstantin,

>Folks, how does ROOT handle C++ exceptions? Does it?
>
>This is what I do: I have a class that has a method that throws a C++
>exception. When I call this method interactively from the ROOT
>command line, ROOT bombs out (on WinNT the ROOT process just exits with
>the "abnormal program termination" message). It looks as if my
>exception is not caught by ROOT, but is passed to the system default
>exception catcher. I did not try this on any UNIX system, should I?
>I am using the ROOT 2.00/09 on WinNT4.0sp3.
>
>So my question is: how do I prevent ROOT from bombing out?

 ROOT/CINT does not hanbdle C++ exception.

>I did try to type in the command enclosed into a try/catch block
>(root% try { myObject.myMethod() } catch (...) {}). ROOT did not complain,
>called myMethod (which throes the exception) and bombed out, as if
>try/catch were not there.

 To be precise, CINT parses and handles exception only within interpreted
code to some extent. But CINT can not catch exception from precompiled code.
Also, CINT's exception handing is very premature even in purely interpreted 
code. Please do not rely on it.

>Should I give up on trying to use C++ exceptions with ROOT?

Right now, you need to give up using C++ exceptions.

Masaharu Goto



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