Search in sources :

Example 1 with ErrorResponseFormat

use of com.linkedin.restli.server.ErrorResponseFormat in project rest.li by linkedin.

the class IndividualResponseException method createErrorResponse.

private static ErrorResponse createErrorResponse(HttpStatus status, String message, ErrorResponseBuilder errorResponseBuilder) {
    ErrorResponse errorResponse = new ErrorResponse();
    ErrorResponseFormat errorResponseFormat = errorResponseBuilder.getErrorResponseFormat();
    if (errorResponseFormat.showStatusCodeInBody()) {
        errorResponse.setStatus(status.getCode());
    }
    if (errorResponseFormat.showMessage()) {
        errorResponse.setMessage(message);
    }
    return errorResponse;
}
Also used : ErrorResponseFormat(com.linkedin.restli.server.ErrorResponseFormat) ErrorResponse(com.linkedin.restli.common.ErrorResponse)

Aggregations

ErrorResponse (com.linkedin.restli.common.ErrorResponse)1 ErrorResponseFormat (com.linkedin.restli.server.ErrorResponseFormat)1