From 81cb75f821807ef8fc7fc6bb6ac59a5626ff7de1 Mon Sep 17 00:00:00 2001 From: Javier Goizueta Date: Thu, 21 Jan 2016 18:24:49 +0100 Subject: [PATCH] Refactor statusFromErrorMessage ...to make jshint happy --- lib/cartodb/controllers/base.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/cartodb/controllers/base.js b/lib/cartodb/controllers/base.js index 52251602..b402b412 100644 --- a/lib/cartodb/controllers/base.js +++ b/lib/cartodb/controllers/base.js @@ -249,11 +249,9 @@ function statusFromErrorMessage(errMsg) { else if (errMsg.match(/Postgis Plugin.*[\s|\n].*column.*does not exist/)) { statusCode = 400; } - else if ( -1 !== errMsg.indexOf('does not exist') ) { + else if ( -1 !== errMsg.indexOf('does not exist') && !errMsg.match(/function .* does not exist/ ) ) { if ( -1 !== errMsg.indexOf(' role ') ) { statusCode = 403; // role 'xxx' does not exist - } else if ( errMsg.match(/function .* does not exist/) ) { - statusCode = 400; // SQL error } else { statusCode = 404; }