How return error message in spring mvc @Controller

前端 未结 4 1936
一向
一向 2020-12-23 02:17

I am using methods like this

@RequestMapping(method = RequestMethod.GET)
public ResponseEntity getUser(@RequestHeader(value=\"Access-ke         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-23 02:25

    return new ResponseEntity<>(GenericResponseBean.newGenericError("Error during the calling the service", -1L), HttpStatus.EXPECTATION_FAILED);
    

提交回复
热议问题