Problem 209

Summary: behaviour of G4Exception
Product: Geant4 Reporter: Florence.Ranjard
Component: globalAssignee: Makoto.Asai
Status: RESOLVED FIXED    
Severity: normal CC: Gabriele.Cosmo
Priority: P2    
Version: other   
Hardware: PC   
OS: Linux   

Description Florence.Ranjard 2001-01-29 09:20:35 CET
Dear Sirs,


 I have a request about the notion of G4Exception.
It is not real exception, it is just function (not a class!)
which calls abort(). I am not sure that we would be  pleasured
by such behaviour in the nearest future.
For us it would be significantly more prefferrable if G4Exception
would throw "true" exception (it is very convinient for us if this
exception would inherit from std::exception class), and the "client"
(GiGa or Gaudi)  is responsible to catch this exception
and perform some action.

   With my best personal regards, Vanya Belyaev
Comment 1 Gabriele Cosmo 2001-01-29 10:09:59 CET
By design G4Exception is a simple function printing some diagnostics and
aborting the application when invoked. For reasons mainly related to
performance, C++ exception handling is not used in Geant4. However, we
recently extended the current mechanism by introducing the capability
of handling/customising G4Exceptions by making G4UIManager "state"
dependent, therefore allowing users to define the desired application
behavior once in 'abort' state, also allowing to print -any- kind of
diagnostics or performing 'safe' operations before the actual abortion.
The user documentation needs to be updated to reflect these features.
Handed this over to Makoto...   :)
Comment 2 Makoto.Asai 2001-02-08 20:44:59 CET
Documents should be added by next public release...
Comment 3 Makoto.Asai 2001-08-19 13:07:59 CEST
Now the user has an UI command (/control/suppressAbortion) to suppress
the G4Exception at event loop. Of course messages are still displayed.
It is contained in Geant4-V03-02-ref-01.