mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 15:27:21 +01:00
Invoke instead of Send UserPushData to catch the exception from the server
This commit is contained in:
parent
605c1d3774
commit
34e55641a7
1 changed files with 11 additions and 2 deletions
|
|
@ -1,6 +1,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using MareSynchronos.API;
|
||||
using MareSynchronos.Utils;
|
||||
using Microsoft.AspNetCore.SignalR.Client;
|
||||
|
||||
namespace MareSynchronos.WebAPI;
|
||||
|
|
@ -18,7 +20,14 @@ public partial class ApiController
|
|||
|
||||
public async Task UserPushData(CharacterCacheDto characterCache, List<string> visibleCharacterIds)
|
||||
{
|
||||
await _mareHub!.SendAsync(nameof(UserPushData), characterCache, visibleCharacterIds).ConfigureAwait(false);
|
||||
try
|
||||
{
|
||||
await _mareHub!.InvokeAsync(nameof(UserPushData), characterCache, visibleCharacterIds).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.Warn("Failed to Push character data: " + ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<List<ClientPairDto>> UserGetPairedClients()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue