Public Member Functions | Private Attributes | List of all members
gov::fnal::cd::rms::base::RmsRuntimeException Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-24/rms/cxx/include/base/RmsRuntimeException.h"

Inheritance diagram for gov::fnal::cd::rms::base::RmsRuntimeException:
gov::fnal::cd::rms::base::RmsExitingProcessException gov::fnal::cd::rms::base::RmsNotConnectedException

Public Member Functions

 RmsRuntimeException (const std::string &fileName, int line, const std::string &message)
 
virtual ~RmsRuntimeException () throw ()
 
const char * what () const throw ()
 

Private Attributes

std::string _fullText
 

Detailed Description

Class to report runtime exceptions.

Author
Kurt Biery
Steve Foulkes
Version
Revision
1.2.14.1
Date
2019/09/27 00:07:31

Definition at line 42 of file RmsRuntimeException.h.

Constructor & Destructor Documentation

gov::fnal::cd::rms::base::RmsRuntimeException::RmsRuntimeException ( const std::string fileName,
int  line,
const std::string message 
)
inline

Constructs a runtime exception instance from the specified file, line number, and message.

Definition at line 50 of file RmsRuntimeException.h.

References _fullText, allTimeWatchdog::endl, compare_h5_caf::idx, make_syst_table_plots::line, gen_hdf5record::size, and string.

51  {
52 
53  // convert the line number to a string
54  std::stringstream tmpStream;
55  tmpStream << line;
56  std::string lineNumber = tmpStream.str();
57 
58  // build up the exception text
59  _fullText = message + "\n" + " RmsRuntimeException generated at " +
60  fileName + ":" + lineNumber;
61 
62  // add some limited stack trace information
63  void *array[10];
64  size_t size;
65  char **strings;
66  size_t idx;
67 
68  size = backtrace (array, 10);
69  strings = backtrace_symbols (array, size);
70  tmpStream.seekp(0); // clear out the stream
71  for (idx = 0; idx < size; idx++) {
72  tmpStream << " " << strings[idx] << std::endl;
73  }
74  free (strings);
75 
76  _fullText += "\n Stack trace:\n" + tmpStream.str();
77  }
fileName
Definition: plotROC.py:78
enum BeamMode string
virtual gov::fnal::cd::rms::base::RmsRuntimeException::~RmsRuntimeException ( )
throw (
)
inlinevirtual

Destructor.

Definition at line 82 of file RmsRuntimeException.h.

82  {
83  return;
84  }

Member Function Documentation

const char* gov::fnal::cd::rms::base::RmsRuntimeException::what ( ) const
throw (
)
inline

Returns a description of the exception.

Definition at line 89 of file RmsRuntimeException.h.

References _fullText.

89  {
90  return _fullText.c_str();
91  }

Member Data Documentation

std::string gov::fnal::cd::rms::base::RmsRuntimeException::_fullText
private

The full description of the exception.

Definition at line 98 of file RmsRuntimeException.h.

Referenced by RmsRuntimeException(), and what().


The documentation for this class was generated from the following file: