I ran into a situation where I wanted to get the error message from the underlying C library (this is when the failure callback is called for connect).
The workaround I made was doing a const_cast on the token reference passed to the callback, and then calling try_wait, in order to trigger check_ret, which includes the error message in the exception it throws.
It would be nicer if you could just access the message on the token like you can for the reason code and return code.
I ran into a situation where I wanted to get the error message from the underlying C library (this is when the failure callback is called for connect).
The workaround I made was doing a
const_cast
on the token reference passed to the callback, and then callingtry_wait
, in order to triggercheck_ret
, which includes the error message in the exception it throws.It would be nicer if you could just access the message on the token like you can for the reason code and return code.