Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TError.h File Reference
#include <DllImport.h>
#include "RtypesCore.h"
#include <cstdarg>
#include <functional>
Include dependency graph for TError.h:

Namespaces

namespace  ROOT
 This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
 
namespace  ROOT::Internal
 

Macros

#define R__ASSERT(e)
 
#define R__CHECK(e)
 

Typedefs

typedef void(* ErrorHandlerFunc_t) (int level, Bool_t abort, const char *location, const char *msg)
 
using ROOT::Internal::ErrorSystemMsgHandlerFunc_t = std::function< const char *()>
 Retrieves the error string associated with the last system error.
 

Functions

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 "real" (in C++ sense) ABC.
 
void Break (const char *location, const char *msgfmt,...)
 Use this function in case an error occurred.
 
void DefaultErrorHandler (int level, Bool_t abort, const char *location, const char *msg)
 The default error handler function.
 
void Error (const char *location, const char *msgfmt,...)
 Use this function in case an error occurred.
 
void ErrorHandler (int level, const char *location, const char *fmt, std::va_list va)
 General error handler function. It calls the user set error handler.
 
void Fatal (const char *location, const char *msgfmt,...)
 Use this function in case of a fatal error. It will abort the program.
 
ErrorHandlerFunc_t GetErrorHandler ()
 Returns the current error handler function.
 
ErrorSystemMsgHandlerFunc_t ROOT::Internal::GetErrorSystemMsgHandler ()
 
void Info (const char *location, const char *msgfmt,...)
 Use this function for informational messages.
 
void MayNotUse (const char *method)
 This function can be used in classes that should override a certain function, but in the inherited class the function makes no sense.
 
void ROOT::Internal::MinimalErrorHandler (Int_t level, Bool_t abort_bool, const char *location, const char *msg)
 A very simple error handler that is usually replaced by the TROOT default error handler.
 
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.
 
ErrorSystemMsgHandlerFunc_t ROOT::Internal::SetErrorSystemMsgHandler (ErrorSystemMsgHandlerFunc_t h)
 Returns the previous system error message handler.
 
void SysError (const char *location, const char *msgfmt,...)
 Use this function in case a system (OS or GUI) related error occurred.
 
void Warning (const char *location, const char *msgfmt,...)
 Use this function in warning situations.
 

Variables

Int_t gErrorAbortLevel
 
Int_t gErrorIgnoreLevel
 
Bool_t gPrintViaErrorHandler
 
const char * kAssertMsg
 
const Int_t kBreak
 
const char * kCheckMsg
 
const Int_t kError
 
const Int_t kFatal
 
const Int_t kInfo
 
const Int_t kPrint
 
const Int_t kSysError
 
const Int_t kUnset
 
const Int_t kWarning
 

Macro Definition Documentation

◆ R__ASSERT

#define R__ASSERT (   e)
Value:
do { \
if (!(e)) ::Fatal("", kAssertMsg, _QUOTE_(e), __LINE__, __FILE__); \
} while (false)
#define _QUOTE_(name)
Definition RConfig.hxx:463
#define e(i)
Definition RSha256.hxx:103
const char * kAssertMsg
Definition TError.cxx:47
void Fatal(const char *location, const char *msgfmt,...)
Use this function in case of a fatal error. It will abort the program.
Definition TError.cxx:256

Definition at line 117 of file TError.h.

◆ R__CHECK

#define R__CHECK (   e)
Value:
do { \
if (!(e)) ::Warning("", kCheckMsg, _QUOTE_(e), __LINE__, __FILE__); \
} while (false)
const char * kCheckMsg
Definition TError.cxx:48
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
Definition TError.cxx:241

Definition at line 121 of file TError.h.

Typedef Documentation

◆ ErrorHandlerFunc_t

typedef void(* ErrorHandlerFunc_t) (int level, Bool_t abort, const char *location, const char *msg)

Definition at line 69 of file TError.h.

Function Documentation

◆ AbstractMethod()

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 "real" (in C++ sense) ABC.

If this function is called it will warn the user that the function should have been overridden.

Definition at line 171 of file TError.cxx.

◆ Break()

void Break ( const char *  location,
const char *  msgfmt,
  ... 
)

Use this function in case an error occurred.

Definition at line 219 of file TError.cxx.

◆ DefaultErrorHandler()

void DefaultErrorHandler ( Int_t  level,
Bool_t  abort_bool,
const char *  location,
const char *  msg 
)

The default error handler function.

It prints the message on stderr and if abort is set it aborts the application. Replaces the minimal error handler of TError.h as part of the gROOT construction. TError's minimal handler is put back in place during the gROOT destruction.

Note
abort() is only called if abort_bool is true and level < gErrorIgnoreLevel

Definition at line 102 of file TErrorDefaultHandler.cxx.

◆ Error()

void Error ( const char *  location,
const char *  msgfmt,
  ... 
)

Use this function in case an error occurred.

Definition at line 197 of file TError.cxx.

◆ ErrorHandler()

void ErrorHandler ( int  level,
const char *  location,
const char *  fmt,
std::va_list  va 
)

General error handler function. It calls the user set error handler.

Definition at line 121 of file TError.cxx.

◆ Fatal()

void Fatal ( const char *  location,
const char *  fmt,
  ... 
)

Use this function in case of a fatal error. It will abort the program.

Warning
Fatal() will not abort the program if gErrorIgnoreLevel > kFatal
  • but for all reasonable settings it will abort.

Definition at line 256 of file TError.cxx.

◆ GetErrorHandler()

ErrorHandlerFunc_t GetErrorHandler ( )

Returns the current error handler function.

Definition at line 112 of file TError.cxx.

◆ Info()

void Info ( const char *  location,
const char *  msgfmt,
  ... 
)

Use this function for informational messages.

Definition at line 230 of file TError.cxx.

◆ MayNotUse()

void MayNotUse ( const char *  method)

This function can be used in classes that should override a certain function, but in the inherited class the function makes no sense.

Definition at line 180 of file TError.cxx.

◆ Obsolete()

void Obsolete ( const char *  function,
const char *  asOfVers,
const char *  removedFromVers 
)

Use this function to declare a function obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 189 of file TError.cxx.

◆ SetErrorHandler()

ErrorHandlerFunc_t SetErrorHandler ( ErrorHandlerFunc_t  newhandler)

Set an errorhandler function. Returns the old handler.

Definition at line 102 of file TError.cxx.

◆ SysError()

void SysError ( const char *  location,
const char *  msgfmt,
  ... 
)

Use this function in case a system (OS or GUI) related error occurred.

Definition at line 208 of file TError.cxx.

◆ Warning()

void Warning ( const char *  location,
const char *  msgfmt,
  ... 
)

Use this function in warning situations.

Definition at line 241 of file TError.cxx.

Variable Documentation

◆ gErrorAbortLevel

Int_t gErrorAbortLevel
extern

Definition at line 44 of file TError.cxx.

◆ gErrorIgnoreLevel

Int_t gErrorIgnoreLevel
extern

Definition at line 43 of file TError.cxx.

◆ gPrintViaErrorHandler

Bool_t gPrintViaErrorHandler
extern

Definition at line 45 of file TError.cxx.

◆ kAssertMsg

const char* kAssertMsg
extern

Definition at line 47 of file TError.cxx.

◆ kBreak

const Int_t kBreak
extern

Definition at line 39 of file TError.cxx.

◆ kCheckMsg

const char* kCheckMsg
extern

Definition at line 48 of file TError.cxx.

◆ kError

const Int_t kError
extern

Definition at line 38 of file TError.cxx.

◆ kFatal

const Int_t kFatal
extern

Definition at line 41 of file TError.cxx.

◆ kInfo

const Int_t kInfo
extern

Definition at line 36 of file TError.cxx.

◆ kPrint

const Int_t kPrint
extern

Definition at line 35 of file TError.cxx.

◆ kSysError

const Int_t kSysError
extern

Definition at line 40 of file TError.cxx.

◆ kUnset

const Int_t kUnset
extern

Definition at line 34 of file TError.cxx.

◆ kWarning

const Int_t kWarning
extern

Definition at line 37 of file TError.cxx.