From d0980a2872ddaa86a7ceecddd3faf35b633b12e4 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Mon, 11 Jul 2016 10:42:46 +0200 Subject: [PATCH] Return last error message for failed nodes on map creation --- NEWS.md | 4 ++++ lib/cartodb/controllers/map.js | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) 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;