Re: repeated try{} catch{}

From: Paul Russo <russo_at_fnal.gov>
Date: Thu, 10 Jun 2010 17:10:05 -0500


Akira,

Your problem is caused by a defect in the CINT bytecode generator.

You can either run your script with the bytecode generator turned off like this:

root [0] .L except.C+
root [1] .O0 // Note: This is a capital letter O followed by the digit zero.
root [2] .x test.C

which has a large performance penalty, or you could modify your test.C script so it compiles by adding a #include "./except.C" at the beginning and then afterwards running it in root as a compiled script this way:

root [0] .x test.C+

The second option should be your preferred option, you gain the full error checking of the compiler and native code performance as as opposed to interpreted performance.

It would be a large effort to improve the CINT bytecode generator to support this code and we will not be able to devote effort to doing so at this time.

On 6/9/2010 9:17 PM, OKUMURA, Akira wrote:
> Hello ROOTers,
>
> I cannot use try & catch repeatedly in a for loop. Am I doing wrong? Is there any hack to handle exceptions in ROOT scripts?
>
> The attached example does not finish the for loop of 100 times.
>
> root [0] .L except.C+
> Info in <TUnixSystem::ACLiC>: creating shared library /mnt/hgfs/oxon_On_My_Mac/./except_C.so
> root [1] .x test.C
> Warning in <TClass::TClass>: no dictionary for class exception is available
> Exception MyError: This is error message
> 0th exception is catched here.
> This is error message
> Exception MyError: This is error message
> root [2]
>
> I am using 5.27.02 on Mac and Linux.
>
> Regards,
>
> --
> OKUMURA, Akira oxon@{astro.isas.jaxa.jp,stanford.edu}
> Institute of Space and Astronautical Science (ISAS/JAXA)
> Now at KIPAC/SLAC/Stanford
> Varian Physics #306
> 382 Via Pueblo Mall, MC 406 Stanford, CA94305
> TEL 650-736-0971/FAX 650-724-5065
> Skype : okumura.akira
Received on Fri Jun 11 2010 - 00:10:12 CEST

This archive was generated by hypermail 2.2.0 : Sat Jun 12 2010 - 17:50:01 CEST