GENIEGenerator
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
InteractionException.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3  Copyright (c) 2003-2024, The GENIE Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5 
6  Jeremy Wolcott <jwolcott \at fnal.gov>
7  Tufts University
8 */
9 //____________________________________________________________________________
10 
11 
12 #include <iostream>
13 
14 #include "InteractionException.h"
15 
16 namespace genie
17 {
18  namespace exceptions
19  {
20 
22  : fReason("")
23  {}
24 
25  InteractionException::InteractionException (const std::string& reason)
26  : fReason(reason)
27  {}
28 
29  void InteractionException::Print (std::ostream& stream) const
30  {
31  stream << "**EXCEPTION Reason: " << this->ShowReason() << std::endl;
32  }
33 
34  } /* namespace exceptions */
35 } /* namespace genie */
36 
37 std::ostream & operator<< (std::ostream& stream, const genie::exceptions::InteractionException & exc)
38 {
39  exc.Print(stream);
40  return stream;
41 }
const std::string & ShowReason() const
Exception used inside Interaction classes.
ostream & operator<<(ostream &stream, const TClonesArray *particle_list)
Definition: gtestDecay.cxx:223
void Print(std::ostream &stream) const