47const char *
kAssertMsg =
"%s violated at line %d of `%s'";
48const char *
kCheckMsg =
"%s not true at line %d of `%s'";
85 fprintf(stderr,
"\n *** Break *** ");
86 fprintf(stderr,
"<%s>: %s\n", location ? location :
"unspecified location", msg);
89 fprintf(stderr,
"aborting\n");
123 thread_local Int_t buf_size(256);
124 thread_local char *buf_storage(
nullptr);
127 char *buf = buf_storage ? buf_storage : small_buf;
129 std::va_list ap_copy;
133 fmt =
"no error message provided";
135 Int_t n = vsnprintf(buf, buf_size, fmt, ap_copy);
140 if (buf != &(small_buf[0]))
142 buf_storage = buf =
new char[buf_size];
146 vsnprintf(buf, buf_size, fmt, ap_copy);
150 std::string bp = buf;
156 bp += std::string(
"(errno: ") + std::to_string(errno) +
")";
173 Warning(method,
"this method must be overridden!");
182 Warning(method,
"may not use this method");
189void Obsolete(
const char *function,
const char *asOfVers,
const char *removedFromVers)
191 Warning(function,
"obsolete as of %s and will be removed from %s", asOfVers, removedFromVers);
197void Error(
const char *location,
const char *fmt, ...)
208void SysError(
const char *location,
const char *fmt, ...)
219void Break(
const char *location,
const char *fmt, ...)
230void Info(
const char *location,
const char *fmt, ...)
241void Warning(
const char *location,
const char *fmt, ...)
256void 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)
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()
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.