From 11e0ac89d270e0846cf70c044ecb42ff404cf55c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Mart=C3=ADn?= Date: Fri, 24 Nov 2017 12:22:30 +0100 Subject: [PATCH] undo test of postgres9.5 error --- .travis.yml | 1 + app/postgresql/error_handler.js | 2 +- test/acceptance/app.test.js | 12 +++++++----- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8183905f..c16b8feb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ addons: - ubuntu-toolchain-r-test packages: - g++-4.8 + - postgresql: 9.5 before_install: # Add custom PPAs from cartodb diff --git a/app/postgresql/error_handler.js b/app/postgresql/error_handler.js index b618ffef..132ddb39 100644 --- a/app/postgresql/error_handler.js +++ b/app/postgresql/error_handler.js @@ -18,7 +18,7 @@ ErrorHandler.prototype.getMessage = function() { // return conditionToMessage[this.err.code] || this.err.message; if (message && (message.match(/statement timeout/) || - message === /RuntimeError: Execution of function interrupted by signal/) + message.indexOf('RuntimeError: Execution of function interrupted by signal') > -1) ) { message = conditionToMessage[pgErrorCodes.conditionToCode.query_canceled]; } diff --git a/test/acceptance/app.test.js b/test/acceptance/app.test.js index 549579b1..ff6642fd 100644 --- a/test/acceptance/app.test.js +++ b/test/acceptance/app.test.js @@ -812,11 +812,13 @@ it('GET with callback must return 200 status error even if it is an error', func } }, function(err, res) { - var body = JSON.parse(res.body); - assert.deepEqual(body.error, [ - 'You are over platform\'s limits. Please contact us to know more details' - ]); - + var error = JSON.parse(res.body); + assert.deepEqual(error, { + error: [ + 'You are over platform\'s limits. Please contact us to know more details' + ] + }); + done(); }); });