33 #ifdef OOMPH_HAS_STACKTRACE 51 namespace Global_timings
67 namespace TerminateHelper
89 (*Error_message_stream_pt) << (*Exception_stringstream_pt).str();
108 std::runtime_error(
"")
123 if (!Suppress_error_message)
125 (*Exception_stream_pt) << (*Exception_stringstream_pt).str();
141 const char *location,
143 std::ostream &exception_stream,
144 const unsigned &output_width,
145 bool list_trace_back) :
146 std::runtime_error(
"OomphException")
162 for(
unsigned i=0;
i<output_width;
i++) {exception_header +=
"=";}
163 exception_header +=
"\n";
166 exception_header +=
"Oomph-lib ";
167 exception_header += exception_type;
170 exception_header +=
"\n\n at ";
171 exception_header += location;
172 exception_header +=
"\n\n in ";
173 exception_header += function_name;
176 exception_header +=
"\n\n";
179 for(
unsigned i=0;
i<(unsigned)(0.8*output_width);
i++)
180 {exception_header +=
"-";}
183 (*Exception_stringstream_pt) << exception_header << std::endl;
186 (*Exception_stringstream_pt) << std::endl << error_description << std::endl;
188 #ifdef OOMPH_HAS_STACKTRACE 197 for(
unsigned i=0;
i<output_width;
i++) {(*Exception_stringstream_pt) <<
"=";}
198 (*Exception_stringstream_pt) << std::endl << std::endl;
202 (*TerminateHelper::Exception_stringstream_pt)<<
203 (*Exception_stringstream_pt).str();
238 namespace Global_output_stream
256 namespace Global_unsigned
273 namespace Global_string_for_annotation
std::ostream * Exception_stream_pt
Exception stream to which we write message in destructor.
bool Suppress_error_message
Boolean to suppress issuing of the error message in destructor (useful if error is caught successfull...
OomphLibException(const std::string &error_description, const std::string &function_name, const char *location, const std::string &exception_type, std::ostream &exception_stream, const unsigned &output_width, bool list_trace_back)
Constructor takes the error description, function name and a location string provided by the OOMPH_EX...
Nullstream oomph_nullstream
Single (global) instantiation of the Nullstream.
void spawn_errors_from_uncaught_errors()
Function to spawn messages from uncaught errors.
std::vector< std::string > String
Storage for strings that may be used for global annotations. This is global data and you use it at yo...
A small nullstream class that throws away everything sent to it.
static std::ostream * Stream_pt
Output stream that is used to write the errors.
OutputModifier default_output_modifier
Single global instatiation of the default output modifier.
bool Doc_comprehensive_timings
Global boolean to switch on comprehensive timing – can probably be declared const false when develop...
std::stringstream * Exception_stringstream_pt
String stream that records the error message.
unsigned Number
The unsigned.
void setup()
Setup terminate helper.
static std::ostream * Stream_pt
Output stream that is used to write the errors.
static unsigned Output_width
Width of output.
std::ofstream * Outfile
Output stream.
static void print_stacktrace(std::ostream &exception_stream, unsigned int max_frames=63)
static unsigned Output_width
Width in characters of the output report.
OomphLibQuietException()
Constructor.
void suppress_exception_error_messages()
Flush string stream of error messages (call when error has been caught)
std::ostream * Error_message_stream_pt
Stream to output error messages.
std::stringstream * Exception_stringstream_pt
String stream that records the error message.
~OomphLibException()
The destructor cannot throw an exception (C++ STL standard)
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.