Loading src/main/java/es/redmic/exception/common/ExceptionType.java +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public enum ExceptionType implements ExceptionTypeItfc { ES_BBOX_QUERY_ERROR(Constants.ES_BBOX_QUERY_ERROR), ES_HISTOGRAM_INTERVAL_QUERY_ERROR(Constants.ES_HISTOGRAM_INTERVAL_QUERY_ERROR), ES_TERM_QUERY_ERROR(Constants.ES_TERM_QUERY_ERROR), ES_QUERY_ERROR(Constants.ES_QUERY_ERROR), ES_INSERT_DOCUMENT(Constants.ES_INSERT_DOCUMENT), ES_CREATE_MAPPING_ERROR(Constants.ES_CREATE_MAPPING_ERROR), Loading Loading @@ -186,6 +187,7 @@ public enum ExceptionType implements ExceptionTypeItfc { ES_BBOX_QUERY_ERROR = "ESBboxQueryError", ES_HISTOGRAM_INTERVAL_QUERY_ERROR = "ESHistogramIntervalQueryError", ES_TERM_QUERY_ERROR = "ESTermQueryError", ES_QUERY_ERROR = "ESQueryError", ES_INSERT_DOCUMENT = "ESInsertError", ES_CREATE_MAPPING_ERROR = "ESCreateMappingError", Loading src/main/java/es/redmic/exception/elasticsearch/ESQueryException.java 0 → 100644 +13 −0 Original line number Diff line number Diff line package es.redmic.exception.elasticsearch; import es.redmic.exception.common.BadRequestException; import es.redmic.exception.common.ExceptionType; public class ESQueryException extends BadRequestException { private static final long serialVersionUID = 3658782399097632577L; public ESQueryException() { super(ExceptionType.ES_QUERY_ERROR); } } src/main/resources/i18n/messages_en_EN.properties +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ ESNotExistsType=Type {0} does not exist in index {1}. ESBboxQueryError=Error. Impossible to perform the query by Bbox with the input parameters. ESHistogramIntervalQueryError=Error. The interval sent {0} does not match the set of supported intervals. ESTermQueryError=Error. Term {0} with value {1} is not as expected. ESQueryError=Error. Query is erroneous. ESInsertError=Error. Register with field {0} and value {1} already exists. ESCreateMappingError=Error. Mapping for index {0} could not be created. Loading src/main/resources/i18n/messages_es_ES.properties +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ ESNotExistsType=El tipo {0} no existe en el ESBboxQueryError=Error. Imposible realizar la query por bbox con los parámetros de entrada. ESHistogramIntervalQueryError=Error. El intervalo de agrupación enviado {0} no coincide con el conjunto de intervalos soportados ESTermQueryError=Error. El término {0} con valor {1} no es el esperado. ESQueryError=Error. La consulta realizada es erronea. ESInsertError=Error. El registro con campo {0} y valor {1} ya existe. ESCreateMappingError=Error. El mapping para el índice {0} no se ha podido crear. Loading src/test/java/es/redmic/test/unit/exception/elasticsearch/ESQueryExceptionTest.java 0 → 100644 +18 −0 Original line number Diff line number Diff line package es.redmic.test.unit.exception.elasticsearch; import java.io.IOException; import org.junit.Test; import es.redmic.exception.common.ExceptionType; import es.redmic.exception.elasticsearch.ESQueryException; import es.redmic.test.unit.exception.common.BaseExceptionTest; public class ESQueryExceptionTest extends BaseExceptionTest { @Test public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException { checkMessage(new ESQueryException(), ExceptionType.ES_QUERY_ERROR.toString(), null); } } No newline at end of file Loading
src/main/java/es/redmic/exception/common/ExceptionType.java +2 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ public enum ExceptionType implements ExceptionTypeItfc { ES_BBOX_QUERY_ERROR(Constants.ES_BBOX_QUERY_ERROR), ES_HISTOGRAM_INTERVAL_QUERY_ERROR(Constants.ES_HISTOGRAM_INTERVAL_QUERY_ERROR), ES_TERM_QUERY_ERROR(Constants.ES_TERM_QUERY_ERROR), ES_QUERY_ERROR(Constants.ES_QUERY_ERROR), ES_INSERT_DOCUMENT(Constants.ES_INSERT_DOCUMENT), ES_CREATE_MAPPING_ERROR(Constants.ES_CREATE_MAPPING_ERROR), Loading Loading @@ -186,6 +187,7 @@ public enum ExceptionType implements ExceptionTypeItfc { ES_BBOX_QUERY_ERROR = "ESBboxQueryError", ES_HISTOGRAM_INTERVAL_QUERY_ERROR = "ESHistogramIntervalQueryError", ES_TERM_QUERY_ERROR = "ESTermQueryError", ES_QUERY_ERROR = "ESQueryError", ES_INSERT_DOCUMENT = "ESInsertError", ES_CREATE_MAPPING_ERROR = "ESCreateMappingError", Loading
src/main/java/es/redmic/exception/elasticsearch/ESQueryException.java 0 → 100644 +13 −0 Original line number Diff line number Diff line package es.redmic.exception.elasticsearch; import es.redmic.exception.common.BadRequestException; import es.redmic.exception.common.ExceptionType; public class ESQueryException extends BadRequestException { private static final long serialVersionUID = 3658782399097632577L; public ESQueryException() { super(ExceptionType.ES_QUERY_ERROR); } }
src/main/resources/i18n/messages_en_EN.properties +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ ESNotExistsType=Type {0} does not exist in index {1}. ESBboxQueryError=Error. Impossible to perform the query by Bbox with the input parameters. ESHistogramIntervalQueryError=Error. The interval sent {0} does not match the set of supported intervals. ESTermQueryError=Error. Term {0} with value {1} is not as expected. ESQueryError=Error. Query is erroneous. ESInsertError=Error. Register with field {0} and value {1} already exists. ESCreateMappingError=Error. Mapping for index {0} could not be created. Loading
src/main/resources/i18n/messages_es_ES.properties +1 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,7 @@ ESNotExistsType=El tipo {0} no existe en el ESBboxQueryError=Error. Imposible realizar la query por bbox con los parámetros de entrada. ESHistogramIntervalQueryError=Error. El intervalo de agrupación enviado {0} no coincide con el conjunto de intervalos soportados ESTermQueryError=Error. El término {0} con valor {1} no es el esperado. ESQueryError=Error. La consulta realizada es erronea. ESInsertError=Error. El registro con campo {0} y valor {1} ya existe. ESCreateMappingError=Error. El mapping para el índice {0} no se ha podido crear. Loading
src/test/java/es/redmic/test/unit/exception/elasticsearch/ESQueryExceptionTest.java 0 → 100644 +18 −0 Original line number Diff line number Diff line package es.redmic.test.unit.exception.elasticsearch; import java.io.IOException; import org.junit.Test; import es.redmic.exception.common.ExceptionType; import es.redmic.exception.elasticsearch.ESQueryException; import es.redmic.test.unit.exception.common.BaseExceptionTest; public class ESQueryExceptionTest extends BaseExceptionTest { @Test public void checkPattern_IsEqualToMessage_WhenNoLocaleSet() throws IOException { checkMessage(new ESQueryException(), ExceptionType.ES_QUERY_ERROR.toString(), null); } } No newline at end of file