Search in sources :

Example 1 with RestApiErrorResult

use of com.vip.saturn.job.console.domain.RestApiErrorResult in project Saturn by vipshop.

the class RestApiExceptionHandlerController method constructErrorResponse.

private ResponseEntity<Object> constructErrorResponse(String errorMsg, HttpStatus status) {
    HttpHeaders httpHeaders = new HttpHeaders();
    RestApiErrorResult restApiErrorResult = new RestApiErrorResult();
    restApiErrorResult.setMessage(errorMsg);
    return new ResponseEntity<Object>(restApiErrorResult, httpHeaders, status);
}
Also used : RestApiErrorResult(com.vip.saturn.job.console.domain.RestApiErrorResult) HttpHeaders(org.springframework.http.HttpHeaders) ResponseEntity(org.springframework.http.ResponseEntity)

Example 2 with RestApiErrorResult

use of com.vip.saturn.job.console.domain.RestApiErrorResult in project Saturn by vipshop.

the class AbstractRestController method constructErrorResponse.

private ResponseEntity<Object> constructErrorResponse(String errorMsg, HttpStatus status) {
    HttpHeaders httpHeaders = new HttpHeaders();
    httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
    RestApiErrorResult restApiErrorResult = new RestApiErrorResult();
    restApiErrorResult.setMessage(errorMsg);
    return new ResponseEntity<Object>(restApiErrorResult, httpHeaders, status);
}
Also used : RestApiErrorResult(com.vip.saturn.job.console.domain.RestApiErrorResult) HttpHeaders(org.springframework.http.HttpHeaders) ResponseEntity(org.springframework.http.ResponseEntity)

Example 3 with RestApiErrorResult

use of com.vip.saturn.job.console.domain.RestApiErrorResult in project Saturn by vipshop.

the class SaturnJobConsoleExceptionHandlerController method constructErrorResponse.

private ResponseEntity<Object> constructErrorResponse(String errorMsg, HttpStatus status) {
    HttpHeaders httpHeaders = new HttpHeaders();
    RestApiErrorResult restApiErrorResult = new RestApiErrorResult();
    restApiErrorResult.setMessage(errorMsg);
    return new ResponseEntity<Object>(restApiErrorResult, httpHeaders, status);
}
Also used : RestApiErrorResult(com.vip.saturn.job.console.domain.RestApiErrorResult) HttpHeaders(org.springframework.http.HttpHeaders) ResponseEntity(org.springframework.http.ResponseEntity)

Aggregations

RestApiErrorResult (com.vip.saturn.job.console.domain.RestApiErrorResult)3 HttpHeaders (org.springframework.http.HttpHeaders)3 ResponseEntity (org.springframework.http.ResponseEntity)3