File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed
src/main/java/com/rabbitmq/client/amqp/impl Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -461,12 +461,22 @@ private static void checkResponse(
461461 if (responseCode == CODE_404 ) {
462462 throw new AmqpException .AmqpEntityDoesNotExistException ("Entity does not exist" );
463463 } else {
464- throw new AmqpException (
465- "Unexpected response code: %d instead of %s" ,
466- responseCode ,
467- IntStream .of (expectedResponseCodes )
468- .mapToObj (String ::valueOf )
469- .collect (Collectors .joining (", " )));
464+ String message =
465+ String .format (
466+ "Unexpected response code: %d instead of %s" ,
467+ responseCode ,
468+ IntStream .of (expectedResponseCodes )
469+ .mapToObj (String ::valueOf )
470+ .collect (Collectors .joining (", " )));
471+ try {
472+ LOGGER .info (
473+ "Management request failed: '{}'. Response body: '{}'" ,
474+ message ,
475+ request .responseMessage ().body ());
476+ } catch (Exception e ) {
477+ LOGGER .info ("Could not get management request body: {}" , e .getMessage ());
478+ }
479+ throw new AmqpException (message );
470480 }
471481 }
472482 }
You can’t perform that action at this time.
0 commit comments