title: Problem with cutomizing ErrorAttributeOptions in Spring Reactive
body: <p>In my handler function I have this method</p>
  <pre><code>public Mono&lt;ServerResponse&gt; itemsEx(ServerRequest serverRequest) {
      throw new RuntimeException(&quot;RuntimeException Occured&quot;);
  }
  </code></pre>
  <p>Now, I want to handle this exception, so I override <code>AbstractErrorWebExceptionHandler</code> and create this class.</p>
  <pre><code>package com.learnreactivespring.learnreactivespring.exception;
  
  import lombok.extern.slf4j.Slf4j;
  import org.springframework.boot.autoconfigure.web.ResourceProperties;
  import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
  import org.springframework.boot.web.error.ErrorAttributeOptions;
  import org.springframework.boot.web.reactive.error.ErrorAttributes;
  import org.springframework.context.ApplicationContext;
  import org.springframework.http.HttpStatus;
  import org.springframework.http.MediaType;
  import org.springframework.http.codec.ServerCodecConfigurer;
  import org.springframework.stereotype.Component;
  import org.springframework.web.reactive.function.BodyInserters;
  import org.springframework.web.reactive.function.server.*;
  import reactor.core.publisher.Mono;
  
  import java.util.Map;
  
  @Component
  @Slf4j
  public class FunctionalErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler {
  
  
  public FunctionalErrorWebExceptionHandler(ErrorAttributes errorAttributes,
                                            ApplicationContext applicationContext,
                                            ServerCodecConfigurer serverCodecConfigurer) {
      super(errorAttributes, new ResourceProperties(), applicationContext);
      super.setMessageWriters(serverCodecConfigurer.getWriters());
      super.setMessageReaders(serverCodecConfigurer.getReaders());
  }
  
  @Override
  protected RouterFunction&lt;ServerResponse&gt; getRoutingFunction(ErrorAttributes errorAttributes) {
      return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse);
  
  }
  
  private  Mono&lt;ServerResponse&gt; renderErrorResponse(ServerRequest serverRequest) {
  
      ErrorAttributeOptions errorAttributes = ErrorAttributeOptions.of(ErrorAttributeOptions.Include.MESSAGE);
  
      Map&lt;String, Object&gt; errorAttributesMap = getErrorAttributes(serverRequest, errorAttributes);
      log.info(&quot;errorAttributesMap : &quot; + errorAttributesMap);
  
      return ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR)
              .contentType(MediaType.APPLICATION_JSON)
              .body(BodyInserters.fromValue(errorAttributesMap.get(&quot;message&quot;)));
  
  }
  </code></pre>
  <p>The problem is, that <strong>I have still a Stacktrace in my termina</strong>l... but I explicitly defined ErrorAttributeOptions only with message.
  My current version of Spring Boot is <strong>2.3.1.RELEASE</strong>. In previous version (2.1.1) I didn't have this problem because I used to this</p>
  <pre><code>package com.learnreactivespring.exception;
  
  import lombok.extern.slf4j.Slf4j;
  import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProviders;
  import org.springframework.boot.autoconfigure.web.ResourceProperties;
  import org.springframework.boot.autoconfigure.web.reactive.error.AbstractErrorWebExceptionHandler;
  import org.springframework.boot.web.reactive.error.ErrorAttributes;
  import org.springframework.context.ApplicationContext;
  import org.springframework.http.HttpStatus;
  import org.springframework.http.MediaType;
  import org.springframework.http.codec.ServerCodecConfigurer;
  import org.springframework.stereotype.Component;
  import org.springframework.web.reactive.function.BodyInserters;
  import org.springframework.web.reactive.function.server.*;
  import reactor.core.publisher.Mono;
  
  import java.util.Map;
  
  @Component
  @Slf4j
  public class FunctionalErrorWebExceptionHandler extends AbstractErrorWebExceptionHandler {
  
  
      public FunctionalErrorWebExceptionHandler(ErrorAttributes errorAttributes,
                                                ApplicationContext applicationContext,
                                                ServerCodecConfigurer serverCodecConfigurer) {
          super(errorAttributes, new ResourceProperties(), applicationContext);
          super.setMessageWriters(serverCodecConfigurer.getWriters());
          super.setMessageReaders(serverCodecConfigurer.getReaders());
      }
  
      @Override
      protected RouterFunction&lt;ServerResponse&gt; getRoutingFunction(ErrorAttributes errorAttributes) {
          return RouterFunctions.route(RequestPredicates.all(), this::renderErrorResponse);
  
      }
  
      private  Mono&lt;ServerResponse&gt; renderErrorResponse(ServerRequest serverRequest) {
  
          Map&lt;String, Object&gt; errorAttributesMap = getErrorAttributes(serverRequest, false);
          log.info(&quot;errorAttributesMap : &quot; + errorAttributesMap);
  
          return ServerResponse.status(HttpStatus.INTERNAL_SERVER_ERROR)
                  .contentType(MediaType.APPLICATION_JSON)
                  .body(BodyInserters.fromObject(errorAttributesMap.get(&quot;message&quot;)));
  
      }
  
  
  }
  </code></pre>
  <p>Now, after bumped version of Spring Boot this issue occured.</p>