Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Make the HttpWebRequest provide more details for Put failures
Browse files Browse the repository at this point in the history
  • Loading branch information
glennawatson committed Mar 21, 2019
1 parent 4a2a8c0 commit 672bb47
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Codecov/Upload/HttpWebRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,14 @@ protected override bool Put(Uri url)
}

var putResponse = (HttpWebResponse)putRequest.GetResponseAsync().Result;
return putResponse.StatusCode == HttpStatusCode.OK;

if (putResponse.StatusCode != HttpStatusCode.OK)
{
Log.Verboase($"Cannot send file to the server. Received {putResponse.StatusCode}");
return false;
}

return true;
}
}
}

0 comments on commit 672bb47

Please sign in to comment.