mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
Another fix to error detection...
This commit is contained in:
parent
f2b0875503
commit
0a4f58d160
@ -87,8 +87,20 @@ public static string FormatQueryParameters(IEnumerable<KeyValuePair<string, stri
|
||||
return builder.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO see issue #5
|
||||
/// </summary>
|
||||
/// <param name="json">String of JSON</param>
|
||||
/// <param name="error">Enum indicating the error, .None if there is no error</param>
|
||||
/// <returns>True when the JSON could be parsed and it didn't describe a known Last.Fm error.</returns>
|
||||
public static bool IsResponseValid(string json, out LastFmApiError error)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(json))
|
||||
{
|
||||
error = LastFmApiError.Unknown;
|
||||
return false;
|
||||
}
|
||||
|
||||
JObject jo;
|
||||
try
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user