Store ignored error information

The errors that are ignored by readwritesplit are now stored as the
current close reason in the Backend. This allows the information about the
error to be retained and it can be used later in the error handler to
display the true reason why the connection was closed.
This commit is contained in:
Markus Mäkelä
2019-12-17 07:49:58 +02:00
parent aa801c74c5
commit b0a1eddb6c
3 changed files with 17 additions and 2 deletions

View File

@ -357,6 +357,16 @@ public:
*/
void set_close_reason(const std::string& reason);
/**
* Get latest close reason
*
* @return A human-readable reason why the connection was closed
*/
const std::string& close_reason() const
{
return m_close_reason;
}
private:
/**
* Internal state of the backend