#include <ErrorUtil.hpp>
|
static void | SetErrorStream (std::ostream &o) |
|
static void | SetPrintBacktrace (bool b) |
|
static bool | HasCustomErrorStream () |
|
static void | Error (ErrType type, const char *routine, int lineNumber, const char *msg, unsigned int level, bool DoComm=false) |
|
static void | Error (ErrType type, const char *routine, int lineNumber, const std::string &msg, unsigned int level) |
|
static void | Error (ErrType type, const char *routine, int lineNumber, const char *msg) |
|
Definition at line 56 of file ErrorUtil.hpp.
◆ ErrType
◆ Error() [1/3]
static void Nektar::ErrorUtil::Error |
( |
ErrType |
type, |
|
|
const char * |
routine, |
|
|
int |
lineNumber, |
|
|
const char * |
msg |
|
) |
| |
|
inlinestatic |
Definition at line 192 of file ErrorUtil.hpp.
195 Error(type, routine, lineNumber,
msg, 0);
static void Error(ErrType type, const char *routine, int lineNumber, const char *msg, unsigned int level, bool DoComm=false)
References Error(), and CellMLToNektar.pycml::msg.
◆ Error() [2/3]
static void Nektar::ErrorUtil::Error |
( |
ErrType |
type, |
|
|
const char * |
routine, |
|
|
int |
lineNumber, |
|
|
const char * |
msg, |
|
|
unsigned int |
level, |
|
|
bool |
DoComm = false |
|
) |
| |
|
inlinestatic |
Definition at line 88 of file ErrorUtil.hpp.
92 boost::ignore_unused(DoComm);
100 "Level " + std::to_string(
level) +
" assertion violation\n";
101 #if defined(NEKTAR_DEBUG) || defined(NEKTAR_FULLDEBUG)
102 baseMsg +=
"Where : " + std::string(routine) +
"[" +
103 std::to_string(lineNumber) +
"]\nMessage : ";
105 boost::ignore_unused(routine, lineNumber);
107 baseMsg += std::string(
msg);
112 #if defined(NEKTAR_USE_MPI) && !defined(NEKTAR_USE_CWIPI)
116 MPI_Initialized(&flag);
119 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
123 boost::ignore_unused(DoComm);
126 std::string btMessage(
"");
127 #if defined(NEKTAR_FULLDEBUG)
135 btSize = backtrace(btArray, 40);
136 btStrings = backtrace_symbols(btArray, btSize);
138 for (
int i = 0; i < btSize; ++i)
140 btMessage += std::string(btStrings[i]) +
"\n";
154 (*m_outStream) << btMessage;
156 (*m_outStream) <<
"Fatal : " << baseMsg << std::endl;
159 #if defined(NEKTAR_USE_MPI) && !defined(NEKTAR_USE_CWIPI)
164 MPI_Barrier(MPI_COMM_WORLD);
175 (*m_outStream) << btMessage;
177 (*m_outStream) <<
"Warning : " << baseMsg << std::endl;
182 <<
"Unknown warning type: " << baseMsg << std::endl;
Nektar::ErrorUtil::NekError NekError
static bool m_printBacktrace
References efatal, ewarning, CellMLToNektar.pycml::level, m_printBacktrace, and CellMLToNektar.pycml::msg.
Referenced by Error().
◆ Error() [3/3]
static void Nektar::ErrorUtil::Error |
( |
ErrType |
type, |
|
|
const char * |
routine, |
|
|
int |
lineNumber, |
|
|
const std::string & |
msg, |
|
|
unsigned int |
level |
|
) |
| |
|
inlinestatic |
◆ HasCustomErrorStream()
static bool Nektar::ErrorUtil::HasCustomErrorStream |
( |
| ) |
|
|
inlinestatic |
◆ SetErrorStream()
static void Nektar::ErrorUtil::SetErrorStream |
( |
std::ostream & |
o | ) |
|
|
inlinestatic |
◆ SetPrintBacktrace()
static void Nektar::ErrorUtil::SetPrintBacktrace |
( |
bool |
b | ) |
|
|
inlinestatic |
◆ m_outStream
std::ostream * Nektar::ErrorUtil::m_outStream = &std::cerr |
|
staticprivate |
◆ m_printBacktrace
bool Nektar::ErrorUtil::m_printBacktrace = true |
|
staticprivate |