00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #include <string>
00011
00012 #include "StDataException.h"
00013
00014
00015 StDataException::StDataException( const std::string& description,
00016 ObjectType object,
00017 StUCMException::Severity severity)
00018 : StUCMException(severity),
00019 object_(object) {
00020 setDescription("[DATA:" + typeToString() + "]" + description);
00021 }
00022
00023
00024 StDataException::~StDataException()
00025 {}
00026
00027
00028 StDataException::ObjectType StDataException::getObjectType() const {
00029 return object_;
00030 }
00031
00032
00033 std::string StDataException::typeToString() const {
00034 switch (object_) {
00035 case STORE:
00036 return "STORE";
00037 break;
00038 case COLLECTION:
00039 return "COLLECTION";
00040 break;
00041 case RECORD:
00042 return "RECORD";
00043 break;
00044 case FIELD:
00045 return "FIELD";
00046 break;
00047 default:
00048 return "UNKNOWN";
00049 }
00050 }