New C/Py api utility function PyC_Err_Format_Prefix() which raises an error with...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 Sep 2011 10:43:55 +0000 (10:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 Sep 2011 10:43:55 +0000 (10:43 +0000)
commit264c63ef03dceeac3ecd2177bbfd26391125a4b7
tree73a9b917084ccd328f4853abfd71ca09dd5ed996
parent5ba213a424185e723a4de5833931847f0fe38c49
New C/Py api utility function PyC_Err_Format_Prefix() which raises an error with the existing error as a suffix.

Use this to raise errors when assigning a string property fails even though the value to assign *is* a string.

Before:
  TypeError: bpy_struct: item.attr= val: Object.name expected a string type, not str

After:
  TypeError: bpy_struct: item.attr= val: Object.name error assigning string, UnicodeEncodeError('utf-8' codec can't encode character '\udce9' in position 23: surrogates not allowed)
source/blender/python/generic/py_capi_utils.c
source/blender/python/generic/py_capi_utils.h
source/blender/python/intern/bpy_rna.c