Parcourir la source

Handle exceptions whicha re thrown while processing application messages.

release/3.x.x
Christian Kratky il y a 7 ans
Parent
révision
e021d5a56b
1 fichiers modifiés avec 9 ajouts et 1 suppressions
  1. +9
    -1
      MQTTnet.Core/Client/MqttClient.cs

+ 9
- 1
MQTTnet.Core/Client/MqttClient.cs Voir le fichier

@@ -238,7 +238,15 @@ namespace MQTTnet.Core.Client
}

var applicationMessage = publishPacket.ToApplicationMessage();
ApplicationMessageReceived?.Invoke(this, new MqttApplicationMessageReceivedEventArgs(applicationMessage));

try
{
ApplicationMessageReceived?.Invoke(this, new MqttApplicationMessageReceivedEventArgs(applicationMessage));
}
catch (Exception exception)
{
MqttTrace.Error(nameof(MqttClient), exception, "Unhandled exception while handling application message.");
}
}

private Task ProcessReceivedPublishPacket(MqttPublishPacket publishPacket)


Chargement…
Annuler
Enregistrer