Search in sources :

Example 1 with ErrorMessage

use of org.openkilda.model.response.ErrorMessage in project open-kilda by telstra.

the class GlobalExceptionMapper method response.

/**
 * Response.
 *
 * @param status the status
 * @param code the code
 * @param auxilaryMessage the auxilary message
 * @param errorDescription the error description
 * @param correlationId the correlation id
 * @param message the message
 * @return the response entity
 */
protected ResponseEntity<Object> response(final HttpStatus status, final Integer code, final String auxilaryMessage, final String message, String correlationId, String errorDescription) {
    MultiValueMap<String, String> headers = new HttpHeaders();
    headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
    return new ResponseEntity<Object>(new ErrorMessage(code, message, auxilaryMessage, correlationId, errorDescription), headers, status);
}
Also used : HttpHeaders(org.springframework.http.HttpHeaders) ResponseEntity(org.springframework.http.ResponseEntity) ErrorMessage(org.openkilda.model.response.ErrorMessage)

Aggregations

ErrorMessage (org.openkilda.model.response.ErrorMessage)1 HttpHeaders (org.springframework.http.HttpHeaders)1 ResponseEntity (org.springframework.http.ResponseEntity)1