Merge 1806 code of vid-common
[vid.git] / vid-app-common / src / main / java / org / onap / vid / aai / exceptions / InvalidAAIResponseException.java
index e629648..f80cae5 100644 (file)
@@ -1,7 +1,13 @@
 package org.onap.vid.aai.exceptions;
 
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.exceptions.GenericUncheckedException;
+
 /**
  * Created by Oren on 7/4/17.
  */
-public class InvalidAAIResponseException extends Exception {
+public class InvalidAAIResponseException extends GenericUncheckedException {
+    public InvalidAAIResponseException(AaiResponse aaiResponse) {
+        super(String.format("errorCode: %d, raw: %s", aaiResponse.getHttpCode(), aaiResponse.getErrorMessage()));
+    }
 }