CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/DQMServices/Core/src/DQMError.cc File Reference

#include "DQMServices/Core/src/DQMError.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Functions

void raiseDQMError (const char *context, const char *fmt,...)

Function Documentation

void raiseDQMError ( const char *  context,
const char *  fmt,
  ... 
)

Definition at line 11 of file DQMError.cc.

References harvestRelVal::args, and argparse::message.

Referenced by MonitorElement::accessRootObject(), DQMStore::cd(), DQMStore::cdInto(), checkRootObject(), MonitorElement::copyFunctions(), DQMStore::createQTest(), DQMOldReceiver::doMonitoring(), DQMStore::findObject(), MonitorElement::getAxis(), DQMStore::getMatchingContents(), MonitorElement::incompatible(), MonitorElement::initialise(), DQMStore::makeDirectory(), DQMStore::readDirectory(), DQMStore::readFile(), QCriterion::runTest(), DQMStore::save(), DQMNet::startLocalServer(), DQMStore::tag(), DQMOldReceiver::update(), DQMStore::useQTest(), and DQMStore::useQTestByMatch().

{
  va_list args;
  char *message = 0;

  va_start(args, fmt);
  vasprintf(&message, fmt, args);
  va_end(args);

#if WITHOUT_CMS_FRAMEWORK
  char *final = 0;
  asprintf(&final, "%s: %s", context, message ? message : FAILED);
  std::runtime_error err(final ? final : FAILED);
  free(final);
#else
  cms::Exception err(context);
  if (message)
    err << message;
#endif

  free(message);
  throw err;
}