Return last error message for failed nodes on map creation

This commit is contained in:
Raul Ochoa 2016-07-11 10:42:46 +02:00
parent 74719e48d9
commit d0980a2872
2 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,11 @@
Released 2016-mm-dd Released 2016-mm-dd
Enhancements:
- Return last error message for failed nodes on map creation.
Announcements: Announcements:
- Upgrades camshaft to [0.35.0](https://github.com/CartoDB/camshaft/releases/tag/0.35.0).
- Upgrades lzma to 2.3.2. - Upgrades lzma to 2.3.2.

View File

@ -349,13 +349,17 @@ function addAnalysesMetadata(username, layergroup, analysesResults, includeQuery
nodes: nodes.reduce(function(nodesIdMap, node) { nodes: nodes.reduce(function(nodesIdMap, node) {
if (node.params.id) { if (node.params.id) {
var nodeResource = layergroup.layergroupid + '/analysis/node/' + node.id(); var nodeResource = layergroup.layergroupid + '/analysis/node/' + node.id();
nodesIdMap[node.params.id] = { var nodeRepr = {
status: node.getStatus(), status: node.getStatus(),
url: getUrls(username, nodeResource) url: getUrls(username, nodeResource)
}; };
if (includeQuery) { if (includeQuery) {
nodesIdMap[node.params.id].query = node.getQuery(); nodeRepr.query = node.getQuery();
} }
if (node.getStatus() === 'failed') {
nodeRepr.error_message = node.getErrorMessage();
}
nodesIdMap[node.params.id] = nodeRepr;
} }
return nodesIdMap; return nodesIdMap;