Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
01a85ce6
Commit
01a85ce6
authored
May 03, 2015
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
servatrice/src/serversocketinterface.cpp
View file @
01a85ce6
...
@@ -160,7 +160,21 @@ void ServerSocketInterface::readClient()
...
@@ -160,7 +160,21 @@ void ServerSocketInterface::readClient()
return
;
return
;
CommandContainer
newCommandContainer
;
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
);
inputBuffer
.
remove
(
0
,
messageLength
);
messageInProgress
=
false
;
messageInProgress
=
false
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment