"git@gitlab.completext.com:quzar/Cockatrice.git" did not exist on "a94cc1c77ce0e13b36415dcbdf261684d3919960"
Commit 01a85ce6 authored by woogerboy21's avatar woogerboy21
Browse files

Merge pull request #1048 from ctrlaltca/crashed_into_you

Catch std exceptions thrown by protobuf and try to pretty print them
parents d2b6daae c6059489
......@@ -160,7 +160,21 @@ void ServerSocketInterface::readClient()
return;
CommandContainer newCommandContainer;
newCommandContainer.ParseFromArray(inputBuffer.data(), messageLength);
try {
newCommandContainer.ParseFromArray(inputBuffer.data(), messageLength);
}
catch(std::exception &e) {
qDebug() << "Caught std::exception in" << __FILE__ << __LINE__ << __PRETTY_FUNCTION__;
qDebug() << "Exception:" << e.what();
qDebug() << "Message coming from:" << getAddress();
qDebug() << "Message length:" << messageLength;
qDebug() << "Message content:" << inputBuffer.toHex();
}
catch(...) {
qDebug() << "Unhandled exception in" << __FILE__ << __LINE__ << __PRETTY_FUNCTION__;
qDebug() << "Message coming from:" << getAddress();
}
inputBuffer.remove(0, messageLength);
messageInProgress = false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment