Adds distinction between pz2 and sp errors
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / errors / ErrorHelper.java
index e75d663..f0da037 100644 (file)
@@ -40,8 +40,8 @@ public class ErrorHelper implements Serializable {
   \r
   public ErrorHelper.ErrorCode getErrorCode(ErrorInterface appError) {\r
     String errmsg = appError.getMessage();\r
-    if (appError.hasPazpar2Error()) {\r
-      if (appError.getPazpar2Error().getMsg().contains("target settings from file")) {\r
+    if (appError.isServiceError()) {\r
+      if (appError.getServiceError().getMsg().contains("target settings from file")) {\r
         return ErrorCode.LOCAL_SETTINGS_FILE_NOT_FOUND;\r
       } else {\r
         return ErrorCode.PAZPAR2_ERRORS;\r
@@ -121,8 +121,8 @@ public class ErrorHelper implements Serializable {
             + "that a pazpar2 service is running at the given address." + nl);\r
         break;           \r
       case PAZPAR2_ERRORS:\r
-        if (error.hasPazpar2Error()) {          \r
-          int pz2code = Integer.parseInt(error.getPazpar2Error().getCode());\r
+        if (error.isServiceError()) {          \r
+          int pz2code = Integer.parseInt(error.getServiceError().getCode());\r
           switch (pz2code) {\r
             case 3:\r
               suggestions.add("The search experienced a problem with the query terms.");\r
@@ -140,7 +140,7 @@ public class ErrorHelper implements Serializable {
               suggestions.add(" that the Service Proxy session timed out.");\r
               break;\r
             default:\r
-              suggestions.add("Pazpar2 error: " + error.getPazpar2Error().getMsg() + " (Pazpar2 # "+error.getPazpar2Error().getCode()+")");\r
+              suggestions.add("Pazpar2 error: " + error.getServiceError().getMsg() + " (Pazpar2 # "+error.getServiceError().getCode()+")");\r
           }\r
           break;\r
         } else {\r