diff --git a/NEWS.md b/NEWS.md index f4ef6d5e..ee637fde 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,7 +4,11 @@ Released 2016-mm-dd +Enhancements: + - Return last error message for failed nodes on map creation. + Announcements: + - Upgrades camshaft to [0.35.0](https://github.com/CartoDB/camshaft/releases/tag/0.35.0). - Upgrades lzma to 2.3.2. diff --git a/lib/cartodb/controllers/map.js b/lib/cartodb/controllers/map.js index 57165447..9b1b3607 100644 --- a/lib/cartodb/controllers/map.js +++ b/lib/cartodb/controllers/map.js @@ -349,13 +349,17 @@ function addAnalysesMetadata(username, layergroup, analysesResults, includeQuery nodes: nodes.reduce(function(nodesIdMap, node) { if (node.params.id) { var nodeResource = layergroup.layergroupid + '/analysis/node/' + node.id(); - nodesIdMap[node.params.id] = { + var nodeRepr = { status: node.getStatus(), url: getUrls(username, nodeResource) }; 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;