Testing whether imported function failed

G

Guest

To all,

I have to make a lot of calls to a C++ library binded to python.
The problem is that the functions/methods don't raise
exceptions when they fail to do their job. Instead they return
a 0 for a failure and a 1 for a successful completion.0

I spent two days tracking down a bug that could have easily
been found if the call loudly failed. Is there anyway to
blanket test this integer 1/0 output so I can catch these
errors before they become untraceable?

Thank you,
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top