mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-17 21:54:54 +00:00
Adds try/catch to Communication_BytesReceived callback to prevent exception from getting logged when malformed message is received
This commit is contained in:
@@ -166,6 +166,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
void Communication_BytesReceived(object sender, GenericCommMethodReceiveBytesArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// This is probably not thread-safe buffering
|
||||
// Append the incoming bytes with whatever is in the buffer
|
||||
@@ -246,6 +248,11 @@ namespace PepperDash.Essentials.Devices.Displays
|
||||
// Save whatever partial message is here
|
||||
IncomingBuffer = newBytes;
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
Debug.Console(2, this, "Error parsing feedback: {0}", err);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user