Author: marrs
Date: Thu Mar  6 08:26:02 2014
New Revision: 1574797

URL: http://svn.apache.org/r1574797
Log:
ACE-458 Applied the patch with some changes: there were more locations where 
the error messages could benefit from more information.

Modified:
    
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RESTClientServlet.java
    
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RepositoryValueObject.java

Modified: 
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RESTClientServlet.java
URL: 
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RESTClientServlet.java?rev=1574797&r1=1574796&r2=1574797&view=diff
==============================================================================
--- 
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RESTClientServlet.java
 (original)
+++ 
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RESTClientServlet.java
 Thu Mar  6 08:26:02 2014
@@ -319,8 +319,8 @@ public class RESTClientServlet extends H
             resp.sendRedirect(req.getServletPath() + "/" + 
buildPathFromElements(WORK_FOLDER, workspace.getSessionID(), entityType, 
object.getDefinition()));
         }
         catch (IllegalArgumentException e) {
-            m_logger.log(LogService.LOG_WARNING, "Failed to add entity of 
type: " + entityType, e);
-            resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not add 
entity of type " + entityType);
+            m_logger.log(LogService.LOG_WARNING, "Failed to add entity of 
type: " + entityType + " with data: " + data);
+            resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not add 
entity of type " + entityType + " with data: " + data);
         }
     }
     
@@ -510,8 +510,8 @@ public class RESTClientServlet extends H
             resp.sendRedirect(req.getServletPath() + "/" + 
buildPathFromElements(WORK_FOLDER, workspace.getSessionID(), entityType, 
entityId));
         }
         catch (IllegalArgumentException e) {
-            m_logger.log(LogService.LOG_WARNING, "Failed to update entity of 
type: " + entityType, e);
-            resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not 
update entity of type " + entityType);
+            m_logger.log(LogService.LOG_WARNING, "Failed to update entity of 
type: " + entityType + " with data: " + data, e);
+            resp.sendError(HttpServletResponse.SC_BAD_REQUEST, "Could not 
update entity of type " + entityType + " with data: " + data);
         }
     }
 

Modified: 
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RepositoryValueObject.java
URL: 
http://svn.apache.org/viewvc/ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RepositoryValueObject.java?rev=1574797&r1=1574796&r2=1574797&view=diff
==============================================================================
--- 
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RepositoryValueObject.java
 (original)
+++ 
ace/trunk/org.apache.ace.client.rest/src/org/apache/ace/client/rest/RepositoryValueObject.java
 Thu Mar  6 08:26:02 2014
@@ -26,4 +26,19 @@ import java.util.Map;
 public class RepositoryValueObject {
     public Map<String, String> attributes;
     public Map<String, String> tags;
+    
+    @Override
+    public String toString() {
+        StringBuffer sb = new StringBuffer(getClass().getSimpleName());
+        if (attributes != null) {
+               sb.append(" with attributes [" + attributes.toString() + "]");
+               if (tags != null) {
+                       sb.append(" and");
+               }
+        }
+        if (tags != null) {
+               sb.append(" with tags [" + tags.toString() + "]");
+        }
+        return sb.toString();
+    }
 }
\ No newline at end of file


Reply via email to