I know Boost.MySql invented error_info to deal with this problem. I did not adopt it because
* Deviates the completion signature from well established practice of having error_code as first parameter f(erro_code ec, ...) or This is not true. error_info (now server_diagnostics) are never part of the completion handler signature, but populated by lvalue reference.
* Requires additional parameters to the completion e.g. f(error_code ec, error_info ei, ...) Again, this is not true.
* Raises question about who allocates the string. The string is allocated as any other data passed by lvalue reference.
I'm not saying error_info (aka server_diagnostics) is the solution, but none of these arguments are true.
* The error information is also only useful for logging and the user can't react to it so why not log it right away. I'm not getting this. How can I log something if I can't access it?