Improved error handling.

This commit is contained in:
2018-08-12 10:12:42 +00:00
parent c53386c4f4
commit a51b8955e2
3 changed files with 31 additions and 8 deletions

View File

@@ -12,10 +12,15 @@ Controller::Controller(const uint32_t startChannel)
void Controller::handleTransaction()
{
if (channels.size() != 0 && chrono::duration_cast<chrono::seconds>(chrono::system_clock::now() - lastMessage) < 5s)
toggleACTLED();
else
enableACTLED(false);
try
{
if (channels.size() != 0 && chrono::duration_cast<chrono::seconds>(chrono::system_clock::now() - lastMessage) < 5s)
toggleACTLED();
else
enableACTLED(false);
}
catch (runtime_error)
{}
auto msg = U2FMessage::readNonBlock();