fix db limit error message set order

This commit is contained in:
Eneko Lakasta
2018-07-02 13:02:36 +02:00
parent 23e5cefdf1
commit c874a734fd

View File

@@ -56,13 +56,15 @@ function populateTimeoutErrors (errors) {
error.subtype = 'render';
}
const IS_DATASOURCE_TIMEOUT_ERROR = isDatasourceTimeoutError(error);
if (isTimeoutError(error)) {
error.message = 'You are over platform\'s limits. Please contact us to know more details';
error.type = 'limit';
error.http_status = 429;
}
if (isDatasourceTimeoutError(error)) {
if (IS_DATASOURCE_TIMEOUT_ERROR) {
error.subtype = 'datasource';
error.message = 'You are over platform\'s limits: SQL query timeout error.' +
' Refactor your query before running again or contact CARTO support for more details.';