Properly report error from unsuccessful source table fetching
Report terse error to user, verbose to log
This commit is contained in:
parent
8d326dba2f
commit
70f535d13a
@ -76,7 +76,8 @@ module.exports = function(){
|
||||
}
|
||||
if (res.statusCode != 200) {
|
||||
var msg = res.body.error ? res.body.error : res.body;
|
||||
callback(new Error('unexpected response status (' + res.statusCode + ') for sql query: ' + sql));
|
||||
callback(new Error(msg));
|
||||
console.log('unexpected response status (' + res.statusCode + ') for sql query: ' + sql + ': ' + msg);
|
||||
return;
|
||||
}
|
||||
callback(null, body.rows);
|
||||
|
Loading…
Reference in New Issue
Block a user