@@ -168,7 +168,7 @@ protected void configure() {
168
168
.map ("healthy" ::equals )
169
169
.orElse (false );
170
170
} catch (IOException e ) {
171
- logger ().error ("Unable to parse response {}" , response );
171
+ logger ().error ("Unable to parse response {}" , response , e );
172
172
return false ;
173
173
}
174
174
})
@@ -337,10 +337,10 @@ private void configureIndexer() {
337
337
* Based on the user-configured bucket definitions, creating buckets and corresponding indexes if needed.
338
338
*/
339
339
private void createBuckets () {
340
- logger ().debug ("Creating " + buckets . size () + " buckets (and corresponding indexes)." );
340
+ logger ().debug ("Creating {} buckets (and corresponding indexes)." , buckets . size () );
341
341
342
342
for (BucketDefinition bucket : buckets ) {
343
- logger ().debug ("Creating bucket \" " + bucket .getName () + " \" " );
343
+ logger ().debug ("Creating bucket \" {} \" " , bucket .getName ());
344
344
345
345
@ Cleanup Response response = doHttpRequest (MGMT_PORT , "/pools/default/buckets" , "POST" , new FormBody .Builder ()
346
346
.add ("name" , bucket .getName ())
@@ -382,7 +382,7 @@ private void createBuckets() {
382
382
383
383
checkSuccessfulResponse (queryResponse , "Could not create primary index for bucket " + bucket .getName ());
384
384
} else {
385
- logger ().info ("Primary index creation for bucket " + bucket . getName () + " ignored, since QUERY service is not present." );
385
+ logger ().info ("Primary index creation for bucket {} ignored, since QUERY service is not present." , bucket . getName () );
386
386
}
387
387
}
388
388
}
@@ -406,7 +406,16 @@ private String getInternalIpAddress() {
406
406
*/
407
407
private void checkSuccessfulResponse (final Response response , final String message ) {
408
408
if (!response .isSuccessful ()) {
409
- throw new IllegalStateException (message + ": " + response .toString ());
409
+ String body = null ;
410
+ if (response .body () != null ) {
411
+ try {
412
+ body = response .body ().string ();
413
+ } catch (IOException e ) {
414
+ logger ().debug ("Unable to read body of response: {}" , response , e );
415
+ }
416
+ }
417
+
418
+ throw new IllegalStateException (message + ": " + response .toString () + ", body=" + (body == null ? "<null>" : body ));
410
419
}
411
420
}
412
421
0 commit comments