mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 10:01:27 -07:00
Fix GitHub API ratelimit crashing Bloxstrap (#57)
This commit is contained in:
parent
3a52aeeb67
commit
f842c56466
@ -15,8 +15,15 @@ namespace Bloxstrap.Helpers
|
||||
|
||||
public static async Task<T?> GetJson<T>(string url)
|
||||
{
|
||||
string json = await Program.HttpClient.GetStringAsync(url);
|
||||
return JsonSerializer.Deserialize<T>(json);
|
||||
try
|
||||
{
|
||||
string json = await Program.HttpClient.GetStringAsync(url);
|
||||
return JsonSerializer.Deserialize<T>(json);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return default;
|
||||
}
|
||||
}
|
||||
|
||||
public static string MD5File(string filename)
|
||||
|
Loading…
Reference in New Issue
Block a user