- Object value = DocumentServerUtils.getValue(graph, attrib);
- object.addJSONField(name, value);
+ if (name.equals(NodeRequest.PROPERTY_VALUE_EXCEPTIONS)) {
+ @SuppressWarnings("unchecked")
+ Map<String, Exception> exceptions = (Map<String, Exception>)DocumentServerUtils.getValue(graph, attrib);
+
+ List<String> errorList = object.getJSONField(NodeRequest.ERRORS);
+ if(errorList == null)
+ errorList = new ArrayList<String>();
+
+ for (Map.Entry<String, Exception> entry : exceptions.entrySet()) {
+ String errorMessage = NodeRequestUtils.formatErrorMessage(entry.getKey(), entry.getValue());
+ errorList.add(errorMessage);
+ }
+ object.addJSONField(NodeRequest.ERRORS, errorList);
+
+ } else {
+ Object value = DocumentServerUtils.getValue(graph, attrib);
+ object.addJSONField(name, value);
+ }