Merge pull request #514 from CartoDB/984-sql-timeout-error-message

Improve sql timeout error message
This commit is contained in:
Eneko Lakasta 2018-07-02 13:10:51 +02:00 committed by GitHub
commit 6897101797
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 8 deletions

View File

@ -3,6 +3,8 @@
## 2.1.1
Released 2018-mm-dd
Announcements:
* Improve error message when the DB query is over the user's limits
## 2.1.0
Released 2018-06-13

View File

@ -18,7 +18,8 @@ function isTimeoutError(err) {
function createTimeoutError() {
return new ErrorHandler({
message: 'You are over platform\'s limits. Please contact us to know more details',
message: 'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
context: 'limit',
detail: 'datasource',
http_status: 429

View File

@ -791,7 +791,8 @@ it('GET with callback must return 200 status error even if it is an error', func
var error = JSON.parse(res.body);
assert.deepEqual(error, {
error: [
'You are over platform\'s limits. Please contact us to know more details'
'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
],
context: 'limit',
detail: 'datasource'
@ -817,7 +818,8 @@ it('GET with callback must return 200 status error even if it is an error', func
var error = JSON.parse(res.body);
assert.deepEqual(error, {
error: [
'You are over platform\'s limits. Please contact us to know more details'
'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
],
context: 'limit',
detail: 'datasource'

View File

@ -216,7 +216,8 @@ describe('copy-endpoints', function() {
assert.ifError(err);
assert.deepEqual(JSON.parse(res.body), {
error: [
'You are over platform\'s limits. Please contact us to know more details'
'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
],
context: 'limit',
detail: 'datasource'
@ -251,7 +252,8 @@ describe('copy-endpoints', function() {
},{}, function(err, res) {
assert.ifError(err);
const error = {
error:["You are over platform's limits. Please contact us to know more details"],
error: ['You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',],
context:"limit",
detail:"datasource"
};

View File

@ -98,7 +98,8 @@ describe('timeout', function () {
assert.deepEqual(res, {
error: [
'You are over platform\'s limits. Please contact us to know more details'
'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
],
context: 'limit',
detail: 'datasource'
@ -180,7 +181,8 @@ describe('timeout', function () {
assert.deepEqual(res, {
error: [
'You are over platform\'s limits. Please contact us to know more details'
'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
],
context: 'limit',
detail: 'datasource'

View File

@ -44,7 +44,8 @@ describe('error-handler-factory', function () {
const error = new Error('statement timeout');
const errorHandler = errorHandlerFactory(error);
const expectedError = new ErrorHandler({
message: 'You are over platform\'s limits. Please contact us to know more details',
message: 'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.',
context: 'limit',
detail: 'datasource',
http_status: 429