mirror of
https://github.com/aspnet/JavaScriptServices.git
synced 2025-12-23 01:58:29 +00:00
Don't ignore synchronous errors when calling Node
This commit is contained in:
@@ -32,8 +32,8 @@ namespace Microsoft.AspNet.NodeServices {
|
||||
var response = await client.PostAsync("http://localhost:" + this._portNumber, payload);
|
||||
var responseString = await response.Content.ReadAsStringAsync();
|
||||
|
||||
if (response.StatusCode != HttpStatusCode.OK) {
|
||||
throw new Exception("Node module responded with error: " + responseString);
|
||||
if (!response.IsSuccessStatusCode) {
|
||||
throw new Exception("Call to Node module failed with error: " + responseString);
|
||||
}
|
||||
|
||||
var responseIsJson = response.Content.Headers.ContentType.MediaType == "application/json";
|
||||
|
||||
Reference in New Issue
Block a user