Named maps returning errors=>Array instead of error=>String

This commit is contained in:
Raul Ochoa 2015-06-05 13:38:38 -04:00
parent ebae218219
commit 68c70effec

View File

@ -315,23 +315,22 @@ NamedMapsController.prototype.instantiateTemplate = function(req, res, template_
},
function prepareResponse(err, layergroup) {
if ( err ) {
throw err;
return callback(err, { errors: [''+err] });
}
var tplhash = self.templateMaps.fingerPrint(template).substring(0,8);
layergroup.layergroupid = cdbuser + '@' + tplhash + '@' + layergroup.layergroupid;
self.surrogateKeysCache.tag(res, new NamedMapsCacheEntry(cdbuser, template.name));
return layergroup;
},
callback
callback(null, layergroup);
}
);
};
NamedMapsController.prototype.finish_instantiation = function(err, response, res) {
if (err) {
var statusCode = 400;
response = { error: ''+err };
response = { errors: [''+err] };
if ( ! _.isUndefined(err.http_status) ) {
statusCode = err.http_status;
}
@ -346,7 +345,7 @@ function finishFn(app, res, description, okResponse) {
var statusCode = 200;
if (err) {
statusCode = 400;
response = { error: '' + err };
response = { errors: ['' + err] };
if ( ! _.isUndefined(err.http_status) ) {
statusCode = err.http_status;
}