[C++-sig] How to handle argument error exceptions in boost.python?

Giuseppe Corbelli giuseppe.corbelli at copanitalia.com
Tue Jan 14 16:42:39 CET 2014


On 14/01/2014 12:45, Gary Oberbrunner wrote:
> ...
>> What is the exception you see from the python side? something like:
>>
>> ArgumentError: Python argument types in
>>       function_name(function_args)
>> did not match C++ signature:
>>       cpp_function_name(cpp_args)
>
> That's exactly what I'm trying to figure out! The c++ exception gets
> handled  in handle_exception and it never gets turned into a python exception as far as
> I can tell.

So, what you see in the python side? And what boost version?
I've always seen an ArgumentError being raised when passing wrong argument 
types to the C++ code object and ValueError (I think) when the C++ code object 
raises an exception without a specific C++ to python exception translator 
installed.

-- 
             Giuseppe Corbelli
WASP Software Engineer, Copan Italia S.p.A
Phone: +390303666318  Fax: +390302659932
E-mail: giuseppe.corbelli at copanitalia.com


More information about the Cplusplus-sig mailing list