Adding NS instantiation
[so.git] / so-etsi-nfvo / so-etsi-nfvo-ns-lcm / so-etsi-nfvo-ns-lcm-service / src / main / java / org / onap / so / etsi / nfvo / ns / lcm / rest / exceptions / NsLcmControllerExceptionHandler.java
index 8d9fdbe..3db04fc 100644 (file)
@@ -41,21 +41,18 @@ public class NsLcmControllerExceptionHandler {
                 .body(getInlineResponse400(nsRequestProcessingException));
     }
 
-    private InlineResponse400 getInlineResponse400(final NsRequestProcessingException nsRequestProcessingException) {
+    @ExceptionHandler(Exception.class)
+    public ResponseEntity<InlineResponse400> handleNsRequestProcessingException(final Exception exception) {
+        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new InlineResponse400()
+                .status(HttpStatus.INTERNAL_SERVER_ERROR.value()).detail(exception.getMessage()));
+    }
 
+    private InlineResponse400 getInlineResponse400(final NsRequestProcessingException nsRequestProcessingException) {
         if (nsRequestProcessingException.getProblemDetails() != null) {
             return nsRequestProcessingException.getProblemDetails();
         }
-
         return new InlineResponse400().status(HttpStatus.INTERNAL_SERVER_ERROR.value())
                 .detail(nsRequestProcessingException.getMessage());
-
-    }
-
-    @ExceptionHandler(Exception.class)
-    public ResponseEntity<InlineResponse400> handleNsRequestProcessingException(final Exception exception) {
-        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(new InlineResponse400()
-                .status(HttpStatus.INTERNAL_SERVER_ERROR.value()).detail(exception.getMessage()));
     }
 
 }