aj-r / RiotNet

A .NET/C# client for the Riot Games API
MIT License
23 stars 10 forks source link

Better error reporting for errors from the server #3

Closed aj-r closed 8 years ago

aj-r commented 8 years ago

If the server returns an error object in a 400/500 response, the client still tries to deserialize it as the type it was originally expecting. This results in either a JsonSerializationException or a RestException with no useful message. As such, the user cannot see the error that came from the server, making it difficult to determine the cause of the error.

To fix this, we should throw a RestException containing the error message from the server.