Added support for error reasons without message key

This commit is contained in:
RogueException
2016-07-09 15:39:16 -03:00
parent 953f3b033d
commit ab8c53a342

View File

@@ -136,6 +136,8 @@ namespace Discord.Net.Rest
{
content = _errorDeserializer.Deserialize<JToken>(json);
reason = content.Value<string>("message");
if (reason == null) //Occasionally an error message is given under a different key because reasons
reason = content.ToString(Formatting.None);
}
}
catch { } //Might have been HTML Should we check for content-type?