mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 12:06:58 +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:
parent
47f4d90c5a
commit
1017464980
1 changed files with 70 additions and 63 deletions
|
|
@ -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>
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue