Skip to content
Snippets Groups Projects
Commit 25012d34 authored by Rustam Lotsmanenko (EPAM)'s avatar Rustam Lotsmanenko (EPAM)
Browse files

Revert "handle schema processing exception explicitly"

This reverts commit 9ef8f4b6.
parent f9bb517c
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,6 @@ import javassist.NotFoundException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
......@@ -75,12 +74,6 @@ public class GlobalExceptionMapperCore extends ResponseEntityExceptionHandler {
}
}
@ExceptionHandler(SchemaProcessingException.class)
public ResponseEntity<Object> handleSchemaProcessingException(SchemaProcessingException e) {
return this.getErrorResponse(
new AppException(HttpStatus.BAD_REQUEST.value(), "Error processing schema.", e.getMessage(), e));
}
@ExceptionHandler(Exception.class)
protected ResponseEntity<Object> handleGeneralException(Exception e) {
return this.getErrorResponse(
......
......@@ -23,7 +23,6 @@ import org.mockito.Mock;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.core.common.model.http.RequestStatus;
import org.opengroup.osdu.indexer.schema.converter.exeption.SchemaProcessingException;
import org.powermock.modules.junit4.PowerMockRunner;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.AccessDeniedException;
......@@ -108,12 +107,4 @@ public class GlobalExceptionMapperCoreTest {
ResponseEntity response = this.sut.handleIOException(ioException);
assertEquals(HttpStatus.SC_SERVICE_UNAVAILABLE, response.getStatusCodeValue());
}
@Test
public void should_returnAppException_when_SchemaProcessingExceptionIsThrown() {
SchemaProcessingException schemaProcessingException = new SchemaProcessingException("error processing schema");
ResponseEntity response = this.sut.handleSchemaProcessingException(schemaProcessingException);
assertEquals(HttpStatus.SC_BAD_REQUEST, response.getStatusCodeValue());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment