# endif
;
+#define HandlerCatchSetStatus(rc, returnvalue) \
+ catch (const CIMException &e) \
+ { \
+ PEG_TRACE_STRING( \
+ TRC_CMPIPROVIDERINTERFACE, \
+ Tracer::LEVEL2, \
+ "CIMException: " + e.getMessage()); \
+ CMSetStatusWithString( \
+ rc, \
+ (CMPIrc)e.getCode(), \
+ (CMPIString*)string2CMPIString(e.getMessage())); \
+ PEG_METHOD_EXIT(); \
+ return returnvalue; \
+ } \
+ catch (const Exception &e) \
+ { \
+ PEG_TRACE(( \
+ TRC_CMPIPROVIDERINTERFACE, \
+ Tracer::LEVEL2, \
+ "Exception: %s", (const char *)e.getMessage().getCString())); \
+ CMSetStatusWithString( \
+ rc, \
+ (CMPIrc)CMPI_RC_ERROR_SYSTEM, \
+ (CMPIString*)string2CMPIString(e.getMessage())); \
+ PEG_METHOD_EXIT(); \
+ return returnvalue; \
+ } \
+ catch (...) \
+ { \
+ PEG_TRACE(( \
+ TRC_CMPIPROVIDERINTERFACE, \
+ Tracer::LEVEL2, \
+ "Unknown exception")); \
+ CMSetStatusWithString( \
+ rc, \
+ (CMPIrc)CMPI_RC_ERROR_SYSTEM, \
+ (CMPIString*)string2CMPIString("Unknown exception")); \
+ PEG_METHOD_EXIT(); \
+ return returnvalue; \
+ }
+
+#define HandlerCatchReturnStatus() \
+ catch (const CIMException &e) \
+ { \
+ PEG_TRACE_STRING( \
+ TRC_CMPIPROVIDERINTERFACE, \
+ Tracer::LEVEL2, \
+ "CIMException: " + e.getMessage()); \
+ PEG_METHOD_EXIT(); \
+ CMReturnWithString( \
+ (CMPIrc)e.getCode(), \
+ (CMPIString*)string2CMPIString(e.getMessage())); \
+ } \
+ catch (const Exception &e) \
+ { \
+ PEG_TRACE(( \
+ TRC_CMPIPROVIDERINTERFACE, \
+ Tracer::LEVEL2, \
+ "Exception: %s", (const char *)e.getMessage().getCString())); \
+ PEG_METHOD_EXIT(); \
+ CMReturnWithString( \
+ (CMPIrc)CMPI_RC_ERROR_SYSTEM, \
+ (CMPIString*)string2CMPIString(e.getMessage())); \
+ } \
+ catch (...) \
+ { \
+ PEG_TRACE(( \
+ TRC_CMPIPROVIDERINTERFACE, \
+ Tracer::LEVEL2, \
+ "Unknown exception")); \
+ PEG_METHOD_EXIT(); \
+ CMReturnWithString( \
+ (CMPIrc)CMPI_RC_ERROR_SYSTEM, \
+ (CMPIString*)string2CMPIString("Unknown exception")); \
+ }
+
static CIMPropertyList getList(const char** l)
{
CIMPropertyList pl;
PEG_METHOD_EXIT();
return cmpiInst;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiObjPath;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,(CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
CM_IncludeQualifiers(flgs),
props);
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- PEG_METHOD_EXIT();
- CMReturnWithString(
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
+ HandlerCatchReturnStatus();
+
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_OK);
}
CM_ObjectPath(cop)->getNameSpace(),
qop); //*CM_ObjectPath(cop));
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- PEG_METHOD_EXIT();
- CMReturnWithString(
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
+ HandlerCatchReturnStatus();
+
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_OK);
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
PEG_METHOD_EXIT();
return cmpiEnum;
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- PEG_METHOD_EXIT();
- return NULL;
- }
+ HandlerCatchSetStatus(rc, NULL);
+
// Code flow should never get here.
}
CMSetStatus(rc,CMPI_RC_OK);
}
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- if (rc)
- {
- CMSetStatusWithString(
- rc,
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
- }
+ HandlerCatchSetStatus(rc, data);
+
PEG_METHOD_EXIT();
return data; // "data" will be valid data or nullValue (in error case)
}
String(name),
v);
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- PEG_METHOD_EXIT();
- CMReturnWithString(
- (CMPIrc)e.getCode(),
- (CMPIString*)string2CMPIString(e.getMessage()));
- }
+ HandlerCatchReturnStatus();
+
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_OK);
}
value2CMPIData(v,t,&data);
CMSetStatus(rc,CMPI_RC_OK);
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- CMSetStatus(rc,(CMPIrc)e.getCode());
- }
+ HandlerCatchSetStatus(rc, data);
+
PEG_METHOD_EXIT();
return data; // "data" will be valid data or nullValue (in error case)
}
PEG_METHOD_EXIT();
CMReturn(CMPI_RC_OK);
}
- catch (const CIMException &e)
- {
- PEG_TRACE_STRING(
- TRC_CMPIPROVIDERINTERFACE,
- Tracer::LEVEL2,
- "Exception: " + e.getMessage());
- PEG_METHOD_EXIT();
- CMReturn((CMPIrc)e.getCode());
- }
+ HandlerCatchReturnStatus();
}
}
PEG_METHOD_EXIT();
CMPIBrokerFT *CMPI_Broker_Ftab = & broker_FT;
PEGASUS_NAMESPACE_END
-
-