diff --git a/OWNERS b/OWNERS index f12e957471..ead150ca8a 100644 --- a/OWNERS +++ b/OWNERS @@ -3,6 +3,7 @@ approvers: - gsunner - cliveseldon - ryandawsonuk +- adriangonz reviewers: - axsaucedo - gsunner diff --git a/engine/src/main/java/io/seldon/engine/api/rest/RestClientController.java b/engine/src/main/java/io/seldon/engine/api/rest/RestClientController.java index 8cb08cd178..642aa5b1eb 100644 --- a/engine/src/main/java/io/seldon/engine/api/rest/RestClientController.java +++ b/engine/src/main/java/io/seldon/engine/api/rest/RestClientController.java @@ -245,7 +245,7 @@ private ResponseEntity _predictions(String json) throw new APIException(ApiExceptionType.ENGINE_EXECUTION_FAILURE,e.getMessage()); } } catch (InvalidProtocolBufferException e) { - throw new APIException(ApiExceptionType.ENGINE_INVALID_JSON,""); + throw new APIException(ApiExceptionType.ENGINE_INVALID_RESPONSE_JSON,""); } } @@ -292,7 +292,7 @@ public ResponseEntity feedback(RequestEntity requestEntity) { throw new APIException(ApiExceptionType.ENGINE_EXECUTION_FAILURE,e.getMessage()); } } catch (InvalidProtocolBufferException e) { - throw new APIException(ApiExceptionType.ENGINE_INVALID_JSON,""); + throw new APIException(ApiExceptionType.ENGINE_INVALID_RESPONSE_JSON,""); } } finally diff --git a/engine/src/main/java/io/seldon/engine/exception/APIException.java b/engine/src/main/java/io/seldon/engine/exception/APIException.java index 8c8af4bda0..d8a7130baa 100644 --- a/engine/src/main/java/io/seldon/engine/exception/APIException.java +++ b/engine/src/main/java/io/seldon/engine/exception/APIException.java @@ -27,7 +27,8 @@ public class APIException extends RuntimeException { public enum ApiExceptionType { - ENGINE_INVALID_JSON(201,"Invalid JSON",500), + ENGINE_INVALID_JSON(201,"Invalid JSON",400), + ENGINE_INVALID_RESPONSE_JSON(201,"Invalid Response JSON",500), ENGINE_INVALID_ENDPOINT_URL(202,"Invalid Endpoint URL",500), ENGINE_MICROSERVICE_ERROR(203,"Microservice error",500), ENGINE_INVALID_ABTEST(204,"Error happened in AB Test Routing",500),