Closed
Description
Eduardo Cintra opened SPR-17205 and commented
I have a method in my controller that return a image, but exists some rules that can throws a exception, when this occurs I'm get a 406 error "406 Not Acceptable" instead of the Exception.
My method:
@RequestMapping
(value = "/test", method = RequestMethod.GET, produces = MediaType.IMAGE_PNG_VALUE) @RequestMapping
(value = "/test", method = RequestMethod.GET, produces = MediaType.IMAGE_PNG_VALUE)
public @ResponseBody
byte[] test() {
throw new RuntimeException()
//code that return byte[] image
}
Can anyone help me?
Attachments:
- invalid.png (33.32 kB)
- valid.png (36.48 kB)
Issue Links:
- @RequestMapping produces condition should not impact error responses [SPR-16318] #20865
@RequestMapping
produces condition should not impact error responses ("duplicates")