From: <ba...@us...> - 2009-03-06 21:14:29
|
Revision: 1167 http://omc.svn.sourceforge.net/omc/?rev=1167&view=rev Author: bartw Date: 2009-03-06 21:14:14 +0000 (Fri, 06 Mar 2009) Log Message: ----------- catch conversion errors, and rethrow with useful info. otherwise the provider writer has no idea which property is causing the problem. Modified Paths: -------------- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py Modified: cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py =================================================================== --- cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2009-02-27 00:03:27 UTC (rev 1166) +++ cmpi-bindings/trunk/swig/python/cmpi_pywbem_bindings.py 2009-03-06 21:14:14 UTC (rev 1167) @@ -738,7 +738,11 @@ # if pinst.property_list and \ # prop.name.lower() not in pinst.property_list: # continue - data, _type = self.pywbem2cmpi_value(prop.value, _type=prop.type) + try: + data, _type = self.pywbem2cmpi_value(prop.value, + _type=prop.type) + except TypeError, te: + raise TypeError('Error converting Property %s: Value %s, Type %s; %s' % (prop.name, prop.value, prop.type, str(te))) ctype = _pywbem2cmpi_typemap[_type] if isinstance(prop.value, list): ctype = ctype | cmpi.CMPI_ARRAY This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |