Message: G4Exception behaviour Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None G4Exception behaviour 

Keywords: G4Exception
Forum: Run Management
Date: 24 Jan, 2002
From: Ranjard <Ranjard>

The geant4.4.0 release notes say that the G4Exception behaviour has been 
changed in order to set G4StateManager to "abort" state instead of 
aborting the application.
Could you tell me how to work with it because the code is: 

void G4Exception(const char* s)
{
   if(s)
        {
            G4cerr << s << G4endl;
        }
   if(G4StateManager::GetStateManager()->SetNewState(Abort)) {
     G4cerr << G4endl << "*** G4Exception: Aborting execution ***" <<
G4endl;
     abort();
   } else {
     G4cerr << G4endl << "*** G4Exception: Abortion suppressed ***"
            << G4endl << "*** No guarantee for further execution ***" <<
G4endl;
   }
};

We have gained nothing from such "modification". Now in the case of errors
G4 either aborts or just prints the error message. Moreover the decision 
if the job should be aborted is quite unclear.  


What could be very desirable for us is the possibility to throw the
real exception (not "fictive one")

 e.g. 

class RealExceptionClass: public std::exception
{  ...  };

void G4Exception( const char* s ) 
{
  throw RealExceptionClass( s ) ;
};

Then,  if nobody catches the  exception, the job is aborted else 
somebody (e.g. GiGa) catches the exception, one could decide what
to be done for this concrete exception in the concrete context
e.g. print the error message, stop the job or skip current event or
perform other error handling operations). 

many thanks for your help,
Ivan.Belyaev@cern.ch

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: G4Exception behaviour   (Makoto Asai - 24 Jan, 2002)
 Add Message Add Message
to: "G4Exception behaviour"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]