Similar to the this question. Needed throw a exception with a message using printf-like style instead of string cocatenation or iostreams. Using the C++ 20 Formatting Library:
throw std::runtime_error {
std::format("Critical error! Code {}: {}", errno, strerror(errno))
};
But it not feels ergonomic calling format in all exceptions with formatting, can it get better?