Further stylistic tweaks

This commit is contained in:
SteveSandersonMS
2016-05-31 22:29:27 +01:00
parent 5bb92d02dd
commit cb289fd387
10 changed files with 64 additions and 42 deletions

View File

@@ -64,12 +64,14 @@ namespace Microsoft.AspNetCore.NodeServices
{
return JsonConvert.DeserializeObject<T>(responseString);
}
if (typeof(T) != typeof(string))
{
throw new ArgumentException(
"Node module responded with non-JSON string. This cannot be converted to the requested generic type: " +
typeof(T).FullName);
}
return (T)(object)responseString;
}
}