Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Handle Forbidden status codes from Cloud Foundry

  • Loading branch information...
commit 1187566ba6e137e08229797d0299dc6a5605f7eb 1 parent 32cfa1c
@SaintGimp SaintGimp authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/IronFoundry/Vcap/VcapRequest.cs
View
9 src/IronFoundry/Vcap/VcapRequest.cs
@@ -183,7 +183,7 @@ private void ProcessResponse(IRestResponse response)
}
}
- if (null != parseException)
+ if (parseException != null)
{
errorMessage = String.Format("Error parsing (HTTP {0}):{1}{2}{3}{4}",
response.StatusCode, Environment.NewLine, response.Content, Environment.NewLine, parseException.Message);
@@ -191,11 +191,14 @@ private void ProcessResponse(IRestResponse response)
}
else
{
- if (response.StatusCode == HttpStatusCode.BadRequest ||
- response.StatusCode == HttpStatusCode.NotFound)
+ if (response.StatusCode == HttpStatusCode.BadRequest || response.StatusCode == HttpStatusCode.NotFound)
{
throw new VcapNotFoundException(errorMessage);
}
+ else if (response.StatusCode == HttpStatusCode.Forbidden)
+ {
+ throw new VcapAuthException(errorMessage);
+ }
else
{
throw new VcapException(errorMessage);
Please sign in to comment.
Something went wrong with that request. Please try again.