Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JBIDE-13794] removed server url from HttpClientException #29

Merged
merged 1 commit into from
Mar 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ private HttpClientException createException(IOException ioe, HttpURLConnection c
throws SocketTimeoutException {
try {
int responseCode = connection.getResponseCode();
String errorMessage = createErrorMessage(connection);
String errorMessage = StreamUtils.readToString(connection.getErrorStream());
switch (responseCode) {
case STATUS_INTERNAL_SERVER_ERROR:
return new InternalServerErrorException(errorMessage, ioe);
Expand All @@ -200,21 +200,6 @@ private HttpClientException createException(IOException ioe, HttpURLConnection c
}
}

protected String createErrorMessage(HttpURLConnection connection) throws IOException {
StringBuilder builder = new StringBuilder("Connection to ")
.append(connection.getURL());
String reason = connection.getResponseMessage();
if (!StringUtils.isEmpty(reason)) {
builder.append(": ").append(reason);
}
String errorMessage = StreamUtils.readToString(connection.getErrorStream());
if (!StringUtils.isEmpty(errorMessage)) {
builder.append(", ").append(errorMessage);
}
return builder.toString();
}


private boolean isHttps(URL url) {
return "https".equals(url.getProtocol());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void shouldDeleteDomainWithoutApplications() throws Exception {
}

@Test
public void shouldNotDeleteDomainWithApplications() throws OpenShiftException, SocketTimeoutException {
public void shouldNotDeleteDomainWithApplications() throws OpenShiftException {
IDomain domain = null;
try {
// pre-condition
Expand Down