api.Spectator.GetCurrentGameAsync throws an exception
See original GitHub issueWhy does await api.Spectator.GetCurrentGameAsync
throw an exception if the player is not in a game? It should either return the correct CurrentGame
with populated data or return null.
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
c# - RestSharp GetAsync throws an Exception instead of ...
I'm getting an exception instead of a HttpStatusCode.BadResult when I use GetAsync RestSharp method. Request failed with status code BadRequest.
Read more >HttpClient.GetAsync throws an exception, if server ...
HttpClient.GetAsync throws an exception, if server response has more than one "WWW-Authenticate: Basic" header with different realms.
Read more >HttpClient.GetAsync can throw UriFormatException #4201
UriFormatException is never thrown by the HttpClient.GetAsync method. If you check the code, there is a function CreateUri that accepts both ...
Read more >HttpClient.GetAsync Method (System.Net.Http)
In case of timeout, different exceptions are thrown on different .NET implementations. HttpRequestException is thrown on all applicable .NET Framework versions.
Read more >How to handle failed API calls in C# - ...
What I'd like to do is when the response has a status of 401 - Unauthorized, instead of throwing an exception or returning...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a question of whether this is an issue with Riot Game’s API (https://developer.riotgames.com/) or RiotSharp. The API returns a 404 when the summoner is not in the game, so RiotSharp throws an error for that (I believe). (It doesn’t necessarily have to behave this way).
If you’re getting data back after a match ended, that is going to be 100% on Riot’s API end. RiotSharp just handles requests to the API and returns whatever the API gave back.
I’m fairly sure, that returning a 404 error is the intended behavior, when the summoner isn’t in a game.