On Friday 05 September 2008 20:04:45 you wrote:
> Hi,
>
> I do not think that C++ will let you intercept exception that are caught
> unless you have control of the catching code.
> To log the uncatch exception, you would simply wrap your calls with a
> try catch block.
>
> Cheers,
> Philippe.
>
> If this is really a requirements for your framework then you will need
> to impose some rules on the user.
> Either use a macro to replace 'throw' or derived all their exception
> from a base class.
>
> Tim München wrote:
> > Hi,
> >
> > can the logging of all exceptions (catched and uncatched) within
> > arbitrary user algorithms (C++) run inside of ROOT be accomplished
> > somehow? As a first step, I'd like to just have stdout output at each
> > exception, or the logging of them into a logfile; The user code itself
> > shouldn't have to be adapted/changed in any way to reach that goal. Is
> > this possbile?
> >
> >
> > Thanks,
> >
> > Tim München
Hi Philippe,
I sort of thought (hoped) that ROOT already provided exception base classes (and that ROOT users were using them); so I guess this is not the case?
I had a quick look through the ROOT source (http://root.cern.ch/lxr/source/). The class TException is described in its documentation as "Simulates the coming C++ try/catch/throw functionality"; so I guess it is not actually used, since ROOT users already write C++ code and therefore just use C++'s builtin exception functionality? There's also a class TStdExceptionHandler, used in TSystem. I think this is used to wrap errors like segfaults, floating point exc (div by 0) etc into exceptions, right? I just thought maybe there was a ROOT-provided exception base class that was actually used by user code, where I would've been able to insert logging calls.
Well, thanks so far,
Tim
Received on Sat Sep 06 2008 - 10:50:48 CEST
This archive was generated by hypermail 2.2.0 : Mon Sep 08 2008 - 23:50:01 CEST