-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added logging for server pushed error messages
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Mexc.Net/Objects/Sockets/Subscriptions/MexcErrorSubscription.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using CryptoExchange.Net.Objects; | ||
using CryptoExchange.Net.Objects.Sockets; | ||
using CryptoExchange.Net.Sockets; | ||
using Mexc.Net.Objects.Sockets.Models; | ||
using Microsoft.Extensions.Logging; | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
|
||
namespace Mexc.Net.Objects.Sockets.Subscriptions | ||
{ | ||
internal class MexcErrorSubscription : SystemSubscription<MexcResponse> | ||
{ | ||
public override HashSet<string> ListenerIdentifiers { get; set; } = new HashSet<string> { "0" }; | ||
|
||
public MexcErrorSubscription(ILogger logger) : base(logger, false) | ||
{ | ||
} | ||
|
||
public override Task<CallResult> HandleMessageAsync(SocketConnection connection, DataEvent<MexcResponse> message) | ||
{ | ||
_logger.LogError("Server Error: {Error}", message.Data.Message); | ||
return Task.FromResult(new CallResult(null)); | ||
} | ||
} | ||
} |