4 using std::stringstream;
16 static bool initDone =
false;
199 str<<file<<
":"<<line<<
": "<<descr;
212 s<<
"Error: "<<
err.fMap[
err.fErr];
213 if(
err.GetDescription().empty())
214 s <<
". No description available";
216 s <<
". Description: " <<
err.GetDescription();
226 std::string ret1 = s.str();
227 const char* ret = ret1.c_str();
std::ostream & operator<<(std::ostream &s, const QError &err)
error stream of string error and description
QError_
underlying enum with error types
@ QERR_SHMEM_INVALID_INDEX
@ QERR_ELE_PULSER_STATUS_WRITE
@ QERR_ELE_PULSER_ATT_READ
@ QERR_ELE_BACKPLANE_WRITE
@ QERR_NET_CONNECTION_FAILED
@ QERR_ELE_BACKPLANE_READ
@ QERR_ELE_PULSER_STATUS_READ
@ QERR_UNDEFINED_INTERFACE
@ QERR_ELE_UNDEFINED_REGISTER
@ QERR_ELE_NO_ACKNOLDGEMENT
@ QERR_ELE_PULSER_ATT_WRITE
@ QERR_UNDEFINED_PARAMETER
@ QERR_DB_MAXLINES_EXCEEDED
error class with error type and description
virtual const char * what() const
returns the same information as operator<<
void SetDescription(const std::string &descr)
set error description
void Set(QError_ e=QERR_SUCCESS, const std::string &descr="")
set to error code and description (default is SUCCESS)
const QError & operator=(const QError_ &e)
assignement operator
static void Init()
initialization of fMap
static std::map< QError_, std::string > fMap
map of string error
QError()
Default constructor.
std::string fDescr
error description
const std::string & GetDescription() const
get error description
QError_ fErr
underlying enum
const std::string & ToString() const
error type to string conversion