Hot take: In warnings and error messages intended for developers, not end users,...

@tml@mementomori.social

Hot take: In warnings and error messages intended for developers, not end users, it is counter-productive to use std::strerror() or FormatMessageW() to get human-readable textual descriptions of system error codes.

Instead, write a function that provides the symbolic name for an error code. Like "ENOTTY", "ENOSPC", "ERROR_ALREADY_EXISTS", "ERROR_FILE_NOT_FOUND", etc. *Those* symbolic names are what developers know, what is used in documentation, etc.

Why is there no system API to return these strings? Or is there? If not, is there some suitably licensed well-maintained header-only C++ library for it?