Re: error handling

From: Fons Rademakers (rdm@pcsalo.cern.ch)
Date: Thu Oct 15 1998 - 22:47:22 MEST


Hi Rutger,

   you can change the error handling for all classes (even the ones
not inheriting from TObject (and that therefore call the global ::Error()
routines). To see how to do this look at the source of the TProofServ
class (http://root.cern.ch/root/html/src/TProofServ.cxx.html).
Here you see a new error handler being defined (ProofErrorHandler())
which is activated via the call SetErrorHandler(ProofErrorHandler)
in the TProofServ constructor. In this new error handler you can
call your TGMsgBox etc.

Cheers, Fons.



> 
> 
> Hi,
> 
> I would like to have my 'own' error handling instead of the standard
> TObject::Error(...) TObject::Warning(...), for a certain TObject derived
> class. (typically I want a TGMsgBox to popup with the error message). All
> the error handling members of TObject are not declared virtual, so
> this gives problems. Is this intentionally, and should I thus use some
> other mechanism to catch the errors (I don't really understand the
> ErrorHandler functions/objects? from TError.h)? If not will it be possible
> to make the members virtual?
> 
> Thanks,
> 
> Rutger
> 


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



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