Stormancer / plugins

Open source plugins for Stormancer applications
MIT License
1 stars 2 forks source link

Error log when a client tries to update their friendlist without being authenticated #11

Open jmderuty opened 1 week ago

jmderuty commented 1 week ago

If disconnecting concurrently to updating the friendlist, an error log is produced on the server, because updateFriendList is a Fire&forget API which cannot send back exceptions, which triggers the "unhandled exception" logging system.

{
  "message": "An unhandled async exception occurred : 'System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (NotAuthenticated)\n ---> Stormancer.ClientException: NotAuthenticated\n   at Stormancer.Server.Plugins.Friends.FriendsController.UpdateFriendList(Packet`1 packet) in /_/src/Stormancer.Plugins/Friends/Stormancer.Server.Plugins.Friends/FriendsController.cs:line 286\n   at Stormancer.Server.Plugins.API.ControllerFactory`1.ExecuteRouteAction(ApiCallContext`1 ctx, Func`4 action)\n   at Stormancer.Server.Plugins.API.ControllerFactory`1.ExecuteRouteAction(ApiCallContext`1 ctx, Func`4 action)\n   at Stormancer.Server.Plugins.API.ControllerFactory`1.ExecuteRouteAction(ApiCallContext`1 ctx, Func`4 action)\n   --- End of inner exception stack trace ---'",
  "data": {
    "content": {
      "Type": "AggregateException",
      "Message": "A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. (NotAuthenticated)",
      "Frames": [],
      "InnerExceptions": [
        {
          "Type": "ClientException",
          "Message": "NotAuthenticated",
          "Frames": [ "   at Stormancer.Server.Plugins.Friends.FriendsController.UpdateFriendList(Packet`1 packet) in /_/src/Stormancer.Plugins/Friends/Stormancer.Server.Plugins.Friends/FriendsController.cs:line 286", "   at Stormancer.Server.Plugins.API.ControllerFactory`1.ExecuteRouteAction(ApiCallContext`1 ctx, Func`4 action)", "   at Stormancer.Server.Plugins.API.ControllerFactory`1.ExecuteRouteAction(ApiCallContext`1 ctx, Func`4 action)", "   at Stormancer.Server.Plugins.API.ControllerFactory`1.ExecuteRouteAction(ApiCallContext`1 ctx, Func`4 action)" ],
          "InnerExceptions": []
        }
      ]
    },
    "app": "/darktales/live-1-0/2874dc89-a311-4567-9dbc-fb6d8e76cb12/15?"
  }
}