use of org.wso2.carbon.identity.application.common.IdentityApplicationManagementValidationException in project carbon-identity-framework by wso2.
the class ApplicationManagementServiceImpl method buildImportErrorResponse.
private ImportResponse buildImportErrorResponse(IdentityApplicationManagementClientException e) {
ImportResponse importResponse = new ImportResponse();
importResponse.setResponseCode(ImportResponse.FAILED);
importResponse.setApplicationName(null);
String errorCode = e.getErrorCode() != null ? e.getErrorCode() : INVALID_REQUEST.getCode();
importResponse.setErrorCode(errorCode);
if (e instanceof IdentityApplicationManagementValidationException) {
importResponse.setErrors(((IdentityApplicationManagementValidationException) e).getValidationMsg());
} else {
String message = e.getMessage();
if (StringUtils.isNotBlank(message)) {
importResponse.setErrors(new String[] { e.getMessage() });
}
}
return importResponse;
}
Aggregations