c++ error codes propagation
<p>I work on a legacy code in c++ which uses error codes instead of exceptions. </p>

<p>In this case, fn A() calls B() which calls C() etc. </p>

<p>Now if C() returns the error, i would like to exit at B() itself without having to pass it back to A() and have A() handle the error. However few other team members have the top most function do the error handling. Now which one would be good?</p>

<p>Also in the latter case, since we dont exit early enough, there happens to be multiple return statements. No i have heard somewhere that multiple return in a function should be avoided. If i avoid return then there are nested ifs to deal with.</p>
