File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/ExchangeSharp/API/Exchanges/FTX Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -404,7 +404,11 @@ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValu
404
404
{
405
405
JToken parsedMsg = JToken . Parse ( msg . ToStringFromUTF8 ( ) ) ;
406
406
407
- if ( parsedMsg [ "channel" ] . ToStringInvariant ( ) . Equals ( "trades" )
407
+ if ( parsedMsg [ "type" ] . ToStringInvariant ( ) == "error" )
408
+ {
409
+ throw new APIException ( parsedMsg [ "msg" ] . ToStringInvariant ( ) ) ;
410
+ }
411
+ else if ( parsedMsg [ "channel" ] . ToStringInvariant ( ) . Equals ( "trades" )
408
412
&& ! parsedMsg [ "type" ] . ToStringInvariant ( ) . Equals ( "subscribed" ) )
409
413
{
410
414
foreach ( var data in parsedMsg [ "data" ] )
@@ -424,7 +428,7 @@ await _socket.SendMessageAsync(new
424
428
{
425
429
op = "subscribe" ,
426
430
market = marketSymbols [ i ] ,
427
- channel = "trades"
431
+ channel = "trades" ,
428
432
} ) ;
429
433
}
430
434
} ) ;
You can’t perform that action at this time.
0 commit comments