Commit 00046a79 authored by Noel Alonso's avatar Noel Alonso
Browse files

Añade nuevas excepciones a la factoría

parent ae7f28de
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ import es.redmic.exception.data.DeleteItemException;
import es.redmic.exception.data.ItemAlreadyExistException;
import es.redmic.exception.data.ItemNotFoundException;
import es.redmic.exception.elasticsearch.ESInsertException;
import es.redmic.exception.elasticsearch.ESUpdateException;

public class ExceptionFactory {

@@ -34,6 +35,12 @@ public class ExceptionFactory {
				&& (arguments != null && arguments.size() == 4))
			return new ESInsertException("a", "b");

		if (exceptionType.equals(ExceptionType.ES_UPDATE_DOCUMENT.name()) && (arguments != null))
			return new ESUpdateException("a");

		if (exceptionType.equals(ExceptionType.INTERNAL_EXCEPTION.name()) && (arguments == null))
			return new InternalException(ExceptionType.INTERNAL_EXCEPTION);

		logger.error("No se ha encontrado una excepción válida para el tipo y argumentos recibidos");

		return new InternalException(ExceptionType.INTERNAL_EXCEPTION);