Fix sonar issue 27/133427/1
authoraravind.est <aravindhan.a@est.tech>
Mon, 27 Feb 2023 13:50:09 +0000 (13:50 +0000)
committeraravind.est <aravindhan.a@est.tech>
Mon, 27 Feb 2023 13:50:09 +0000 (13:50 +0000)
Fixed issue with InterruptedException

Issue-ID: POLICY-4525
Signed-off-by: aravind.est <aravindhan.a@est.tech>
Change-Id: I9212469f0b695fea5907dacf185df8f5e77e7fee

participant/participant-impl/participant-impl-kserve/src/main/java/org/onap/policy/clamp/acm/participant/kserve/handler/AutomationCompositionElementHandler.java

index cae7056..07fbce8 100755 (executable)
@@ -138,10 +138,13 @@ public class AutomationCompositionElementHandler implements AutomationCompositio
                 LOGGER.error("Violations found in the config request parameters: {}", violations);
                 throw new ValidationException("Constraint violations in the config request");
             }
-        } catch (ValidationException | ExecutionException | InterruptedException | CoderException e) {
-            throw new KserveException(HttpStatus.SC_BAD_REQUEST, "Invalid Configuration", e);
-        } catch (IOException | ApiException e) {
-            throw new KserveException(HttpStatus.SC_BAD_REQUEST, "Failed to configure the inference service", e);
+        } catch (CoderException e) {
+            throw new KserveException(HttpStatus.SC_BAD_REQUEST, "Invalid inference service configuration", e);
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            throw new KserveException("Interrupt in configuring the inference service", e);
+        } catch (IOException | ExecutionException | ApiException e) {
+            throw new KserveException("Failed to configure the inference service", e);
         }
     }