use of org.apache.syncope.ext.scimv2.api.type.ErrorType in project syncope by apache.
the class SCIMExceptionMapper method builder.
private ResponseBuilder builder(final ClientExceptionType hType, final String msg) {
ResponseBuilder builder = Response.status(hType.getResponseStatus());
ErrorType scimType = null;
if (hType.name().startsWith("Invalid") || hType == ClientExceptionType.RESTValidation) {
scimType = ErrorType.invalidValue;
} else if (hType == ClientExceptionType.EntityExists) {
scimType = ErrorType.uniqueness;
}
return builder.entity(new SCIMError(scimType, hType.getResponseStatus().getStatusCode(), msg));
}
Aggregations