Wednesday, January 02, 2013

Mixing Return Codes and Exceptions in C++

Happy New Year!!

Many projects use libraries developed by different teams, organizations, and open-source communities. It is not rare to see one project using dozens of external libraries where some libraries use return codes for reporting errors and others use exceptions. 

When you find yourself in such a mix, what is the best way forward as far as error handling is concerned? Should you mix return codes and exceptions freely in your code? Should you choose one particular scheme over the other? 

Issues like this are faced by the users of the RTI Connext Request/Reply API, which I helped create. Visit this new blog post on Mixing Return Codes and Exceptions in C++ for my 2 cents.