title: "Could not find acceptable representation" when throwing custom exception
body: <p>Using spring boot version 1.3.3.RELEASE...</p>
  
  <p>I have a resource method like this:</p>
  
  <pre><code>@RequestMapping(value="/{id}", method=RequestMethod.GET, produces = MediaType.APPLICATION_OCTET_STREAM_VALUE)
  public @ResponseBody ResponseEntity&lt;byte[]&gt; getImage(@NotNull @PathVariable("id") String imageId) {
      // get image from database and return byte[]
      if(image == null) {
          throw new ResourceNotFoundException("...");
      }
  }
  </code></pre>
  
  <p>Where <code>ResourceNotFoundException</code> is a simple class like this:</p>
  
  <pre><code>@ResponseStatus(HttpStatus.NOT_FOUND)
  public class ResourceNotFoundException extends RuntimeException {
      private static final long serialVersionUID = 1L;
  
      public ResourceNotFoundException() {
      }
  
      public ResourceNotFoundException(String message) {
          super(message);
      }
  
      public ResourceNotFoundException(String message, Throwable cause) {
          super(message, cause);
      }
  }
  </code></pre>
  
  <p>This methodology works well for all other resources, but I think it gets into a muddle either with the required <code>byte[]</code> response body or the fact that it is producing <code>APPLICATION_OCTET_STREAM_VALUE</code>. Whenever the code gets to the exception, I have this in my logs (and the client actually receives a 500 rather than a 404):</p>
  
  <pre><code>org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation
      at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodProcessor.writeWithMessageConverters(AbstractMessageConverterMethodProcessor.java:251) ~[spring-webmvc-4.2.5.RELEASE.jar!/:4.2.5.RELEASE]
   ...
  </code></pre>
  
  <p>Is there any way I can use custom exceptions in this case? I suppose I can use the <code>ResponseEntity</code>builders, but would be nice to be consistent.</p>
  
  <p>Thanks in advance.</p>