From 214c6845b7eab0a1dd4768c8509388a81a99593b Mon Sep 17 00:00:00 2001 From: Zhun Xu Date: Mon, 28 Oct 2019 16:31:44 -0400 Subject: [PATCH] catch exception other than APIException --- .../seldon/engine/service/InternalPredictionService.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/engine/src/main/java/io/seldon/engine/service/InternalPredictionService.java b/engine/src/main/java/io/seldon/engine/service/InternalPredictionService.java index 4aaa78e12a..9491f40b4d 100644 --- a/engine/src/main/java/io/seldon/engine/service/InternalPredictionService.java +++ b/engine/src/main/java/io/seldon/engine/service/InternalPredictionService.java @@ -523,6 +523,14 @@ private SeldonMessage queryREST( logger.error("Invalid protocol buffer during Json Format merge - ", e); throw new APIException( APIException.ApiExceptionType.ENGINE_MICROSERVICE_ERROR, e.toString()); + } catch (APIException e) + { + throw e; + } catch (Exception e) + { + logger.error("Couldn't retrieve prediction from external prediction server - ", e); + throw new APIException( + APIException.ApiExceptionType.ENGINE_MICROSERVICE_ERROR, e.toString()); } } logger.error("Failed to retrueve predictions after {} attempts", restRetries);