use new AbstractPlatformException in AbstractPlatformException
only indirectly related to FINERACT-942, but makes sense to do so now
This commit is contained in:
committed by
Michael Vorburger ⛑️
parent
56cad56848
commit
bcfbe65d56
+4
-20
@@ -23,11 +23,7 @@ import com.google.common.collect.Iterables;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants;
|
import org.apache.fineract.infrastructure.bulkimport.constants.TemplatePopulateImportConstants;
|
||||||
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
import org.apache.fineract.infrastructure.core.data.ApiParameterError;
|
||||||
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformDomainRuleException;
|
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformException;
|
||||||
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformResourceNotFoundException;
|
|
||||||
import org.apache.fineract.infrastructure.core.exception.AbstractPlatformServiceUnavailableException;
|
|
||||||
import org.apache.fineract.infrastructure.core.exception.PlatformApiDataValidationException;
|
|
||||||
import org.apache.fineract.infrastructure.core.exception.PlatformDataIntegrityException;
|
|
||||||
import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException;
|
import org.apache.fineract.infrastructure.core.exception.UnsupportedParameterException;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellStyle;
|
import org.apache.poi.ss.usermodel.CellStyle;
|
||||||
@@ -278,21 +274,9 @@ public class ImportHandlerUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static String getErrorMessage(RuntimeException re) {
|
public static String getErrorMessage(RuntimeException re) {
|
||||||
if (re instanceof AbstractPlatformDomainRuleException) {
|
if (re instanceof AbstractPlatformException) {
|
||||||
AbstractPlatformDomainRuleException abstractPlatformDomainRuleException = (AbstractPlatformDomainRuleException) re;
|
AbstractPlatformException abstractPlatformException = (AbstractPlatformException) re;
|
||||||
return abstractPlatformDomainRuleException.getDefaultUserMessage();
|
return abstractPlatformException.getDefaultUserMessage();
|
||||||
} else if (re instanceof AbstractPlatformResourceNotFoundException) {
|
|
||||||
AbstractPlatformResourceNotFoundException abstractPlatformResourceNotFoundException = (AbstractPlatformResourceNotFoundException) re;
|
|
||||||
return abstractPlatformResourceNotFoundException.getDefaultUserMessage();
|
|
||||||
} else if (re instanceof AbstractPlatformServiceUnavailableException) {
|
|
||||||
AbstractPlatformServiceUnavailableException abstractPlatformServiceUnavailableException = (AbstractPlatformServiceUnavailableException) re;
|
|
||||||
return abstractPlatformServiceUnavailableException.getDefaultUserMessage();
|
|
||||||
} else if (re instanceof PlatformDataIntegrityException) {
|
|
||||||
PlatformDataIntegrityException platformDataIntegrityException = (PlatformDataIntegrityException) re;
|
|
||||||
return platformDataIntegrityException.getDefaultUserMessage();
|
|
||||||
} else if (re instanceof PlatformApiDataValidationException) {
|
|
||||||
PlatformApiDataValidationException platformApiDataValidationException = (PlatformApiDataValidationException) re;
|
|
||||||
return getDefaultUserMessages(platformApiDataValidationException.getErrors());
|
|
||||||
} else if (re instanceof UnsupportedParameterException) {
|
} else if (re instanceof UnsupportedParameterException) {
|
||||||
UnsupportedParameterException unsupportedParameterException = (UnsupportedParameterException) re;
|
UnsupportedParameterException unsupportedParameterException = (UnsupportedParameterException) re;
|
||||||
return getErrorList(unsupportedParameterException.getUnsupportedParameters());
|
return getErrorList(unsupportedParameterException.getUnsupportedParameters());
|
||||||
|
|||||||
Reference in New Issue
Block a user