38const char *
kAssertMsg =
"%s violated at line %d of `%s'";
39const char *
kCheckMsg =
"%s not true at line %d of `%s'";
76 fprintf(stderr,
"\n *** Break *** ");
77 fprintf(stderr,
"<%s>: %s\n", location ? location :
"unspecified location", msg);
80 fprintf(stderr,
"aborting\n");
114 thread_local Int_t buf_size(256);
115 thread_local char *buf_storage(
nullptr);
118 char *buf = buf_storage ? buf_storage : small_buf;
120 std::va_list ap_copy;
124 fmt =
"no error message provided";
126 Int_t n = vsnprintf(buf, buf_size, fmt, ap_copy);
131 if (buf != &(small_buf[0]))
133 buf_storage = buf =
new char[buf_size];
137 vsnprintf(buf, buf_size, fmt, ap_copy);
141 std::string bp = buf;
147 bp += std::string(
"(errno: ") + std::to_string(errno) +
")";
164 Warning(method,
"this method must be overridden!");
173 Warning(method,
"may not use this method");
182 Warning(
function,
"obsolete as of %s and will be removed from %s", asOfVers, removedFromVers);
188void Error(
const char *location,
const char *fmt, ...)
199void SysError(
const char *location,
const char *fmt, ...)
210void Break(
const char *location,
const char *fmt, ...)
221void Info(
const char *location,
const char *fmt, ...)
232void Warning(
const char *location,
const char *fmt, ...)
247void Fatal(
const char *location,
const char *fmt, ...)
void Error(const char *location, const char *fmt,...)
Use this function in case an error occurred.
void Break(const char *location, const char *fmt,...)
Use this function in case an error occurred.
ErrorHandlerFunc_t GetErrorHandler()
Returns the current error handler function.
void Info(const char *location, const char *fmt,...)
Use this function for informational messages.
static ErrorHandlerFunc_t gErrorHandler
void SysError(const char *location, const char *fmt,...)
Use this function in case a system (OS or GUI) related error occurred.
TVirtualMutex * gErrorMutex
Error handling routines.
static ROOT::Internal::ErrorSystemMsgHandlerFunc_t & GetErrorSystemMsgHandlerRef()
void AbstractMethod(const char *method)
This function can be used in abstract base classes in case one does not want to make the class a "rea...
void ErrorHandler(Int_t level, const char *location, const char *fmt, std::va_list ap)
General error handler function. It calls the user set error handler.
void Warning(const char *location, const char *fmt,...)
Use this function in warning situations.
void MayNotUse(const char *method)
This function can be used in classes that should override a certain function, but in the inherited cl...
void Fatal(const char *location, const char *fmt,...)
Use this function in case of a fatal error. It will abort the program.
void Obsolete(const char *function, const char *asOfVers, const char *removedFromVers)
Use this function to declare a function obsolete.
ErrorHandlerFunc_t SetErrorHandler(ErrorHandlerFunc_t newhandler)
Set an errorhandler function. Returns the old handler.
Bool_t gPrintViaErrorHandler
void(* ErrorHandlerFunc_t)(int level, Bool_t abort, const char *location, const char *msg)
constexpr Int_t kSysError
This class implements a mutex interface.
std::function< const char *()> ErrorSystemMsgHandlerFunc_t
Retrieves the error string associated with the last system error.
void MinimalErrorHandler(int level, Bool_t abort, const char *location, const char *msg)
A very simple error handler that is usually replaced by the TROOT default error handler.
ErrorSystemMsgHandlerFunc_t SetErrorSystemMsgHandler(ErrorSystemMsgHandlerFunc_t h)
Returns the previous system error message handler.
ErrorSystemMsgHandlerFunc_t GetErrorSystemMsgHandler()
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.