Skip to content

Commit efc82c2

Browse files
authored
Fix MEXC ticker overflow (#850)
1 parent eba7a79 commit efc82c2

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

src/ExchangeSharp/API/Exchanges/MEXC/ExchangeMEXCAPI.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,22 @@ protected override async Task<IEnumerable<KeyValuePair<string, ExchangeTicker>>>
7474
foreach (var t in token)
7575
{
7676
var symbol = (t["symbol"] ?? throw new ArgumentNullException()).ToStringInvariant();
77-
tickers.Add(new KeyValuePair<string, ExchangeTicker>(symbol,
78-
await this.ParseTickerAsync(
79-
t,
80-
symbol,
81-
"askPrice",
82-
"bidPrice",
83-
"lastPrice",
84-
"volume",
85-
timestampType: TimestampType.UnixMilliseconds,
86-
timestampKey: "closeTime")));
77+
try
78+
{
79+
tickers.Add(new KeyValuePair<string, ExchangeTicker>(symbol,
80+
await this.ParseTickerAsync(
81+
t,
82+
symbol,
83+
"askPrice",
84+
"bidPrice",
85+
"lastPrice",
86+
"volume",
87+
timestampType: TimestampType.UnixMilliseconds,
88+
timestampKey: "closeTime")));
89+
}
90+
catch (OverflowException)
91+
{
92+
}
8793
}
8894

8995
return tickers;

0 commit comments

Comments
 (0)