MXS-2015: Improve CDC connector error messages

The error messages now display the data received so far. This will help
resolve at which point the streaming process was when an error occurs.
This commit is contained in:
Markus Mäkelä
2018-08-15 17:26:15 +03:00
parent d6ed10975e
commit fb9ffdc753

View File

@ -28,6 +28,7 @@
#include <poll.h> #include <poll.h>
#include <sstream> #include <sstream>
#include <stdexcept> #include <stdexcept>
#include <iterator>
#include <string.h> #include <string.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/types.h> #include <sys/types.h>
@ -280,6 +281,11 @@ bool Connection::connect(const std::string& table, const std::string& gtid)
{ {
rval = true; rval = true;
} }
else
{
m_error += ". Data received so far: ";
std::copy(m_buffer.begin(), m_buffer.end(), std::back_inserter(m_error));
}
} }
} }
} }