Just today I had some code that helpfully said "should never get here" and aborted. It left us to figure out what the possible options of how we could end up in that spot "we should never get to". It was maddening because it's ~12 year old code that had some library updates. A little bit more help like the error code or really *anything* would've been helpful.
A couple of years ago, I redid the error code definitions in an internal C++ library. The error returns were of the form:
-__LINE__
which, if you know C++, means your error code is just the negation of the current line number. That's super convenient when writing. It's really annoying when someone actually sees such an error code and emails you about it -- because they obviously can't do anything with it in software. The obvious problem is that the semantics of an error code depend on the software revision they built with, but you also need to figure out which source file has an error return at that line that the user could have reached at their context.
The new error codes are almost as ergonomic to write (involving a little splash of code generation to make it so, not ideal but worth it). However, they can actually be handled in software and there's a functional perror-equivalent.