Author: ajborley
Date: Tue Nov 28 03:21:23 2006
New Revision: 479993

URL: http://svn.apache.org/viewvc?view=rev&rev=479993
Log:
Python extension updates to deal with errors better

Modified:
    
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
    
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp

Modified: 
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp?view=diff&rev=479993&r1=479992&r2=479993
==============================================================================
--- 
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
 (original)
+++ 
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/PythonServiceWrapper.cpp
 Tue Nov 28 03:21:23 2006
@@ -817,8 +817,8 @@
                         else 
                         {
                             Py_DECREF(pFunc);
-                            Py_DECREF(elementTreeModule);
-                            Py_DECREF(elementTreeModuleName);
+                            Py_XDECREF(elementTreeModule);
+                            Py_XDECREF(elementTreeModuleName);
 
                             if(PyErr_Occurred())
                             {

Modified: 
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp?view=diff&rev=479993&r1=479992&r2=479993
==============================================================================
--- 
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
 (original)
+++ 
incubator/tuscany/cpp/sca/runtime/extensions/python/src/tuscany/sca/python/sca_module.cpp
 Tue Nov 28 03:21:23 2006
@@ -291,8 +291,7 @@
                 PyObject* elementTreeToStringFunc = 
PyObject_GetAttrString(elementTreeModule, "tostring");
                 PyObject* pElemString = 
PyObject_CallFunction(elementTreeToStringFunc, "O", param);
                 char* data = PyString_AsString(pElemString);
-                loginfo("SDO param %d: %s", i, data);
-
+                
                 Py_DECREF(elementTreeToStringFunc);
                 Py_DECREF(pElemString);
 
@@ -316,7 +315,9 @@
                 else
                 {
                     string msg = "xml.etree.ElementTree.Element could not be 
converted to a DataObject";
-                    throwException(ServiceDataException, msg.c_str());
+                    logerror(msg.c_str());
+                    PyErr_SetString(scaError, msg.c_str());
+                    return NULL;
                 }                                    
             }
             else
@@ -452,8 +453,8 @@
 
     }
 
-    Py_DECREF(elementTreeModuleName); 
-    Py_DECREF(elementTreeModule);                        
+    Py_XDECREF(elementTreeModuleName); 
+    Py_XDECREF(elementTreeModule);                        
 
     return returnValue;
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to