Affects: \


  1. I have set up the /actuator/prometheus endpoint
  2. It returns 500 error in any cases
  3. the exception is here https://github.com/spring-projects/spring-framework/blob/main/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java#L306

you can see, that if the body is not null then the code will produce the exception in any case... obviously, it is a bug, isn't it?

PS I checked it in debugger - the body contains metrics of my application as I expected, but I can't get it due to unconditional exception throwing: Spring AbstractMessageConverterMethodProcessor unconditional exception logic

Comment From: bogdanovmn

Well, I've figured out. 1. The code is correct: there is using break