From 713ad03c3b30635cca820ad64e3d48a1ac6ab4a4 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Wed, 16 Sep 2015 01:44:30 +0200 Subject: [PATCH] No need to expose findStatusCode at app level --- lib/cartodb/server.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index 9d8594a0..21d34f0c 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -164,16 +164,6 @@ module.exports = function(serverOptions) { var authApi = new AuthApi(pgConnection, metadataBackend, mapStore, templateMaps); - app.findStatusCode = function(err) { - var statusCode; - if ( err.http_status ) { - statusCode = err.http_status; - } else { - statusCode = statusFromErrorMessage('' + err); - } - return statusCode; - }; - var TablesExtentApi = require('./api/tables_extent_api'); var tablesExtentApi = new TablesExtentApi(pgQueryRunner); @@ -429,7 +419,7 @@ function bootstrap(opts) { label = label || 'UNKNOWN'; - var statusCode = app.findStatusCode(err); + var statusCode = findStatusCode(err); // use console.log for statusCode != 500 ? if (statusCode >= 500) { @@ -516,6 +506,16 @@ function surrogateKeysCacheBackends(serverOptions) { return cacheBackends; } +function findStatusCode(err) { + var statusCode; + if ( err.http_status ) { + statusCode = err.http_status; + } else { + statusCode = statusFromErrorMessage('' + err); + } + return statusCode; +} + function statusFromErrorMessage(errMsg) { // Find an appropriate statusCode based on message var statusCode = 400;