Adds distinction between pz2 and sp errors
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / pazpar2 / data / ResponseDataObject.java
index 3fe9803..8ffd810 100644 (file)
@@ -108,12 +108,15 @@ public class ResponseDataObject implements Serializable {
     return (CommandError) getOneElement("applicationerror");\r
   }\r
   \r
-  public boolean hasPazpar2Error() {\r
-    return hasApplicationError() && getApplicationError().hasPazpar2Error();\r
+  public boolean hasServiceError() {\r
+    return hasApplicationError() \r
+        && getApplicationError().isServiceError();        \r
   }\r
   \r
-  \r
-  \r
+  public ServiceError getServiceError() {\r
+    return (hasServiceError()? getApplicationError().getServiceError() : null);\r
+  }\r
+      \r
   public void setXml(String xml) {\r
     this.xml = xml; \r
   }\r