Skip to content

Commit

Permalink
Gracefully handle PacketErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed May 8, 2015
1 parent 0e64fc4 commit 33c1141
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,11 +1227,14 @@ void Server::ProcessData(NetworkPacket *pkt)
}

handleCommand(pkt);
}
catch(SendFailedException &e) {
} catch (SendFailedException &e) {
errorstream << "Server::ProcessData(): SendFailedException: "
<< "what=" << e.what()
<< std::endl;
} catch (PacketError &e) {
actionstream << "Server::ProcessData(): PacketError: "
<< "what=" << e.what()
<< std::endl;
}
}

Expand Down

1 comment on commit 33c1141

@nerzhul
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great !

Please sign in to comment.