Merge pull request #386 from CartoDB/384-overviews-error-message
Change error messages when getting overviews metadata fails
This commit is contained in:
commit
2a789b5a5b
@ -25,8 +25,7 @@ OverviewsMetadataApi.prototype.getOverviewsMetadata = function (username, sql, c
|
|||||||
var query = 'SELECT * FROM CDB_Overviews(CDB_QueryTablesText($windshaft$' + prepareSql(sql) + '$windshaft$))';
|
var query = 'SELECT * FROM CDB_Overviews(CDB_QueryTablesText($windshaft$' + prepareSql(sql) + '$windshaft$))';
|
||||||
this.pgQueryRunner.run(username, query, function handleOverviewsRows(err, rows) {
|
this.pgQueryRunner.run(username, query, function handleOverviewsRows(err, rows) {
|
||||||
if (err){
|
if (err){
|
||||||
var msg = err.message ? err.message : err;
|
callback(err);
|
||||||
callback(new Error('could not get overviews metadata: ' + msg));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var metadata = {};
|
var metadata = {};
|
||||||
|
@ -334,7 +334,7 @@ describe('tests from old api translated to multilayer', function() {
|
|||||||
|
|
||||||
var parsed = JSON.parse(res.body);
|
var parsed = JSON.parse(res.body);
|
||||||
assert.deepEqual(parsed, {
|
assert.deepEqual(parsed, {
|
||||||
errors: ["could not get overviews metadata: fake error message"]
|
errors: ["fake error message"]
|
||||||
});
|
});
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
Loading…
Reference in New Issue
Block a user