Search in sources :

Example 1 with ErrorReportsWebMessageResponse

use of org.hisp.dhis.dxf2.webmessage.responses.ErrorReportsWebMessageResponse in project dhis2-core by dhis2.

the class WebMessageUtils method errorReports.

public static WebMessage errorReports(List<ErrorReport> errorReports) {
    WebMessage webMessage = new WebMessage();
    webMessage.setResponse(new ErrorReportsWebMessageResponse(errorReports));
    if (!errorReports.isEmpty()) {
        webMessage.setStatus(Status.ERROR);
        webMessage.setHttpStatus(HttpStatus.BAD_REQUEST);
    }
    return webMessage;
}
Also used : ErrorReportsWebMessageResponse(org.hisp.dhis.dxf2.webmessage.responses.ErrorReportsWebMessageResponse)

Aggregations

ErrorReportsWebMessageResponse (org.hisp.dhis.dxf2.webmessage.responses.ErrorReportsWebMessageResponse)1