Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Fixed warnings about broken promises showing up in the non-debug log …
Browse files Browse the repository at this point in the history
…after restarting the game with the tool open.
  • Loading branch information
PazerOP committed Jul 4, 2020
1 parent 7ef886f commit 4562eeb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tf2_bot_detector/Actions/RCONActionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,21 +104,26 @@ void RCONActionManager::ProcessRunningCommands()
if (!resultStr.empty())
{
if (m_WorldState)
{
m_WorldState->AddConsoleOutputChunk(resultStr);
}
else
LogError("WorldState was nullptr when we tried to give it the result: "s << resultStr);
{
LogError("WorldState was nullptr when we tried to give it the result for "s
<< std::quoted(cmd.m_Command) << ": " << resultStr);
}
}
}
catch (const std::future_error& e)
{
if (e.code() == std::future_errc::broken_promise)
LogWarning(std::string(__FUNCTION__) << "(): " << e.code().message() << ": " << e.what());
DebugLogWarning(std::string(__FUNCTION__) << "(): " << e.code().message() << ": " << e.what() << ": " << std::quoted(cmd.m_Command));
else
PrintErrorMsg(e.code().message() << ": " << e.what());
PrintErrorMsg(e.code().message() << ": " << e.what() << ": " << std::quoted(cmd.m_Command));
}
catch (const std::exception& e)
{
PrintErrorMsg(e.what());
PrintErrorMsg(""s << e.what() << ": " << std::quoted(cmd.m_Command));
}

m_RunningCommands.pop();
Expand Down

0 comments on commit 4562eeb

Please sign in to comment.