Skip to content

Commit

Permalink
Revert "couchbase: include error response from couchbase in checkSucc…
Browse files Browse the repository at this point in the history
…essfulResponse() (testcontainers#3006)"

This reverts commit 6e8c18e.
  • Loading branch information
sd-yip committed May 11, 2021
1 parent 4e365f9 commit edbcdab
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected void configure() {
.map("healthy"::equals)
.orElse(false);
} catch (IOException e) {
logger().error("Unable to parse response {}", response, e);
logger().error("Unable to parse response {}", response);
return false;
}
})
Expand Down Expand Up @@ -350,10 +350,10 @@ private void configureIndexer() {
* Based on the user-configured bucket definitions, creating buckets and corresponding indexes if needed.
*/
private void createBuckets() {
logger().debug("Creating {} buckets (and corresponding indexes).", buckets.size());
logger().debug("Creating " + buckets.size() + " buckets (and corresponding indexes).");

for (BucketDefinition bucket : buckets) {
logger().debug("Creating bucket \"{}\"", bucket.getName());
logger().debug("Creating bucket \"" + bucket.getName() + "\"");

@Cleanup Response response = doHttpRequest(MGMT_PORT, "/pools/default/buckets", "POST", new FormBody.Builder()
.add("name", bucket.getName())
Expand Down Expand Up @@ -395,7 +395,7 @@ private void createBuckets() {

checkSuccessfulResponse(queryResponse, "Could not create primary index for bucket " + bucket.getName());
} else {
logger().info("Primary index creation for bucket {} ignored, since QUERY service is not present.", bucket.getName());
logger().info("Primary index creation for bucket " + bucket.getName() + " ignored, since QUERY service is not present.");
}
}
}
Expand All @@ -419,16 +419,7 @@ private String getInternalIpAddress() {
*/
private void checkSuccessfulResponse(final Response response, final String message) {
if (!response.isSuccessful()) {
String body = null;
if (response.body() != null) {
try {
body = response.body().string();
} catch (IOException e) {
logger().debug("Unable to read body of response: {}", response, e);
}
}

throw new IllegalStateException(message + ": " + response.toString() + ", body=" + (body == null ? "<null>" : body));
throw new IllegalStateException(message + ": " + response.toString());
}
}

Expand Down

0 comments on commit edbcdab

Please sign in to comment.