getDatabase: properly handle redis connection failures

This commit is contained in:
Sandro Santilli 2013-01-28 17:30:58 +01:00
parent ac49abe750
commit dd19d74149

View File

@ -35,7 +35,7 @@ module.exports = function() {
var redisKey = _.template(this.user_key, {username: username});
this.retrieve(this.user_metadata_db, redisKey, 'database_name', function(err, dbname) {
if ( err ) callback(err, null);
if ( err ) { callback(err, null); return; }
else if ( dbname === null ) {
callback(new Error("missing " + username + "'s dbname in redis (try CARTODB/script/restore_redis)"), null);
}