Maybe you want something like the lower quartet/byte indicate the error, the function up the stack adds its quartet/byte (shifted by 8 bits) to tell when that error happens, and go up for next quartet/byte. The problem then is to document all the error codes you show to the final user...
Posted Feb 3, 2013 0:37 UTC (Sun) by nix (subscriber, #2304)
[Link]
That doesn't let you include more than a few functions' worth of info, and *also* doesn't let you include a string with variable components.
Doing this gets even more painful when you consider localization. Even GNU gettext, with its support for %s-style elements whose order depends on language, would have trouble here, I fear.