Jersey: Returning 400 error instead of 500 when given invalid request body

前端 未结 4 1958
予麋鹿
予麋鹿 2021-02-18 15:24

I\'m using Jersey\'s integrated Jackson processing to transform incoming JSON to a POJO, e.g.:

@POST
@Consumes(MediaType.APPLICATION_JSON)
public Response newCus         


        
4条回答
  •  暖寄归人
    2021-02-18 16:16

    In dropwizard land there is an ExceptionMapper called JsonProcessingExceptionMapper that has similar functionality as to what you are looking for. Maybe you can use that for inspiration on how to address your specific issue in a non-dropwizard world.

提交回复
热议问题