Skip to content

Commit edbcdab

Browse files
committed
Revert "couchbase: include error response from couchbase in checkSuccessfulResponse() (testcontainers#3006)"
This reverts commit 6e8c18e.
1 parent 4e365f9 commit edbcdab

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

modules/couchbase/src/main/java/org/testcontainers/couchbase/CouchbaseContainer.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected void configure() {
181181
.map("healthy"::equals)
182182
.orElse(false);
183183
} catch (IOException e) {
184-
logger().error("Unable to parse response {}", response, e);
184+
logger().error("Unable to parse response {}", response);
185185
return false;
186186
}
187187
})
@@ -350,10 +350,10 @@ private void configureIndexer() {
350350
* Based on the user-configured bucket definitions, creating buckets and corresponding indexes if needed.
351351
*/
352352
private void createBuckets() {
353-
logger().debug("Creating {} buckets (and corresponding indexes).", buckets.size());
353+
logger().debug("Creating " + buckets.size() + " buckets (and corresponding indexes).");
354354

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

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

396396
checkSuccessfulResponse(queryResponse, "Could not create primary index for bucket " + bucket.getName());
397397
} else {
398-
logger().info("Primary index creation for bucket {} ignored, since QUERY service is not present.", bucket.getName());
398+
logger().info("Primary index creation for bucket " + bucket.getName() + " ignored, since QUERY service is not present.");
399399
}
400400
}
401401
}
@@ -419,16 +419,7 @@ private String getInternalIpAddress() {
419419
*/
420420
private void checkSuccessfulResponse(final Response response, final String message) {
421421
if (!response.isSuccessful()) {
422-
String body = null;
423-
if (response.body() != null) {
424-
try {
425-
body = response.body().string();
426-
} catch (IOException e) {
427-
logger().debug("Unable to read body of response: {}", response, e);
428-
}
429-
}
430-
431-
throw new IllegalStateException(message + ": " + response.toString() + ", body=" + (body == null ? "<null>" : body));
422+
throw new IllegalStateException(message + ": " + response.toString());
432423
}
433424
}
434425

0 commit comments

Comments
 (0)