|
From: <mik...@us...> - 2008-10-02 18:45:44
|
Revision: 1064
http://omc.svn.sourceforge.net/omc/?rev=1064&view=rev
Author: mike-brasher
Date: 2008-10-02 18:45:12 +0000 (Thu, 02 Oct 2008)
Log Message:
-----------
Put master catch and convert (CIMExcpption/CIMErorr) around provider proxy.
Modified Paths:
--------------
cmpi-bindings/trunk/src/cmpi_provider.c
cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
Modified: cmpi-bindings/trunk/src/cmpi_provider.c
===================================================================
--- cmpi-bindings/trunk/src/cmpi_provider.c 2008-10-02 14:00:50 UTC (rev 1063)
+++ cmpi-bindings/trunk/src/cmpi_provider.c 2008-10-02 18:45:12 UTC (rev 1064)
@@ -60,7 +60,10 @@
#endif
+#if 0
SWIGEXPORT void SWIG_init(void);
+#endif
+
#define _CMPI_SETFAIL(msgstr) {if (st != NULL) st->rc = CMPI_RC_ERR_FAILED; st->msg = msgstr; }
/*
Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py
===================================================================
--- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-02 14:00:50 UTC (rev 1063)
+++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2008-10-02 18:45:12 UTC (rev 1064)
@@ -106,10 +106,38 @@
##==============================================================================
##
+## _mwrap()
##
+## Wrap a method in a try block.
##
##==============================================================================
+def _mwrap(obj, meth, *args, **kwds):
+ try:
+ return obj.meth(*args, **kwds)
+ except cmpi.CMPIException,e:
+ raise _exception_to_error(e)
+
+##==============================================================================
+##
+## _fwrap()
+##
+## Wrap a function in a try block.
+##
+##==============================================================================
+
+def _fwrap(meth, *args, **kwds):
+ try:
+ return meth(*args, **kwds)
+ except cmpi.CMPIException,e:
+ raise _exception_to_error(e)
+
+##==============================================================================
+##
+##
+##
+##==============================================================================
+
class ContextWrap(object):
def __init__(self, proxy, cmpicontext):
self.proxy = proxy
@@ -366,7 +394,7 @@
raise pywbem.CIMError(pywbem.CIM_ERR_FAILED,
'New broker not the same as cached broker!')
except KeyError:
- prox = CMPIProxyProvider(miname, broker)
+ prox = ExceptionClassWrapper(CMPIProxyProvider(miname, broker))
g_proxies[miname] = prox
return prox
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|