StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StDataException.cxx
1 /*
2  * @file StDataException.cpp
3  * @author Stephen Tramer
4  *
5  * @(#)cpp/api:$Id: StDataException.cxx,v 1.2 2010/03/30 20:05:36 fine Exp $
6  *
7  * See StDataException.h for detals.
8  */
9 
10 #include <string>
11 
12 #include "StDataException.h"
13 // using namespace TxLogging;
14 
15 StDataException::StDataException( const std::string& description,
16  ObjectType object,
17  StUCMException::Severity severity)
18  : StUCMException(severity),
19  object_(object) {
20  setDescription("[DATA:" + typeToString() + "]" + description);
21 }
22 
23 
25 {} //EMPTY
26 
27 
29  return object_;
30 }
31 
32 
33 std::string StDataException::typeToString() const {
34  switch (object_) {
35  case STORE:
36  return "STORE";
37  break;
38  case COLLECTION:
39  return "COLLECTION";
40  break;
41  case RECORD:
42  return "RECORD";
43  break;
44  case FIELD:
45  return "FIELD";
46  break;
47  default:
48  return "UNKNOWN";
49  }
50 }
StDataException(const std::string &description, ObjectType object, StUCMException::Severity severity=StUCMException::ERROR)
ObjectType getObjectType() const
virtual ~StDataException()