I'd like to put a mention in here of libexplain - http://libexplain.sourceforge.net - that Peter Miller has worked on for many years. It's purpose is somewhat different - you use it in your code (e.g. 'explain_open') in the place of your regular system calls, and if it fails it prints out a complete message why it failed. This even breaks down to which directory or file was missing in the path you've given to open.
But I think Peter's experience and general approach here would be invaluable as groundwork for making errors better in the kernel.