Skip to content

Commit

Permalink
Testing with a catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Mack committed Jun 28, 2024
1 parent 543a692 commit e5d1aa8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/MessageHandlers/_MessageHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public MessageHandler(ILogger<MessageHandler<T>> logger, Utils.PluginDelegates p
}

public void MessageReceived(T message, MessageFormats.Common.DirectToApp fullMessage) => Task.Run(() => {
using (var scope = _serviceProvider.CreateScope()) {
try {
using (var scope = _serviceProvider.CreateScope()) {

if (message == null || EqualityComparer<T>.Default.Equals(message, default)) {
_logger.LogInformation("Received empty message '{messageType}' from '{appId}'. Discarding message.", typeof(T).Name, fullMessage.SourceAppId);
Expand All @@ -30,7 +31,12 @@ public void MessageReceived(T message, MessageFormats.Common.DirectToApp fullMes
case string messageType when messageType.Equals(typeof(MessageFormats.HostServices.Link.LinkRequest).Name, StringComparison.CurrentCultureIgnoreCase):
LinkRequestHandler(message: message as MessageFormats.HostServices.Link.LinkRequest, fullMessage: fullMessage);
break;
}
}
}
catch (Exception ex) {
var no_error = true;
}

});
}

0 comments on commit e5d1aa8

Please sign in to comment.