handle CDS error info 13/413/1
authorSerban Jora <sj2381@att.com>
Tue, 9 Jan 2018 16:04:59 +0000 (11:04 -0500)
committerSerban Jora <sj2381@att.com>
Tue, 9 Jan 2018 16:06:47 +0000 (11:06 -0500)
Change-Id: I505e59fcc9a3bf454a62d37e8af666e1d9ea410f
Signed-off-by: Serban Jora <sj2381@att.com>
gateway/src/main/java/org/acumos/federation/gateway/util/Errors.java

index 649a054..435a662 100644 (file)
@@ -39,8 +39,12 @@ public class Errors {
 
                if (theError.getStatusCode() == HttpStatus.BAD_REQUEST) {
                        String msg = theError.getResponseBodyAsString();
-                       return (msg != null &&
-                                                       msg.startsWith("No entry for ID"));
+                       if (msg != null) {
+                               return ((String)Utils
+                                                                                                       .jsonStringToMap(msg)
+                                                                                                               .getOrDefault("error", ""))
+                                                                                               .startsWith("No entry for ID");
+                       }
                }
                return false;
        }