import java.util.Collection;
import java.util.Collections;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
for(Variable attrib : statics) {
String name = attrib.getName(graph);
try {
- 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);
+ }
} catch (Throwable t) {
List<String> errorList = object.getJSONField(NodeRequest.ERRORS);
if(errorList == null)