Commit dea83205 authored by Romain Bioteau's avatar Romain Bioteau

fix(deploy) open error message when deploy fails

Closes BST-434
parent 94891590
......@@ -44,10 +44,11 @@ public class AddCustomPageRequest extends HttpRequest<String> {
addPageRequest.setEntity(entityBuilder.build());
final HttpResponse response = httpClient.execute(addPageRequest);
final int status = response.getStatusLine().getStatusCode();
String responseContent = contentAsString(response);
if (status != HttpURLConnection.HTTP_OK) {
throw new HttpException(String.format("Add custom page failed with status: %s. Open Engine log for more details.", status));
throw new HttpException(responseContent.isEmpty() ? String.format("Add custom page failed with status: %s. Open Engine log for more details.", status) : responseContent);
}
return contentAsString(response);
return responseContent;
}
......
......@@ -51,11 +51,11 @@ public class UpdateCustomPageRequest extends HttpRequest<String> {
updatePageRequest.setEntity(entityBuilder.build());
final HttpResponse response = httpClient.execute(updatePageRequest);
final int status = response.getStatusLine().getStatusCode();
String responseContent = contentAsString(response);
if (status != HttpURLConnection.HTTP_OK) {
throw new HttpException(
String.format("Update custom page failed with status: %s. Open Engine log for more details.", status));
throw new HttpException(responseContent.isEmpty() ? String.format("Add custom page failed with status: %s. Open Engine log for more details.", status) : responseContent);
}
return contentAsString(response);
return responseContent;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment