I am currently involved in developing a low level network application. We have lately run into the issue of error reporting concerning both user land and debug land. Given that some errors might fire up from lower level functions, libraries ... reporting the exact error status (code, messages, env...) from one layer to another higher layer has revealed to be somewhat cumbersome.
However we have thought to switch back to using exceptions but recently a pal has came out with this approach : Using a class Error_Buf which holds sufficient informations about what causes the error as such error code, buffer message, and passing it as a parameter in functions. Hence whenever something goes wrong, an adequate message and error code are set in error->buffer and error->error_code for example and then are forwarded back to the calling function and an adequate return value is sent.
This is actually what we use to do in c (at least libnet does something similar) but how is this near or far from efficiency and robustness, code maintainability might be an issue too.
Thank you,