diff --git a/src/apps.js b/src/apps.js index de497c345..6d616c383 100644 --- a/src/apps.js +++ b/src/apps.js @@ -689,10 +689,10 @@ function validateLocations(locations, callback) { if (error) return callback(error); for (let location of locations) { - if (!(location.domain in domainObjectMap)) return callback(new AppsError(AppsError.BAD_FIELD, 'No such domain', { field: 'location' })); + if (!(location.domain in domainObjectMap)) return callback(new AppsError(AppsError.BAD_FIELD, 'No such domain', { field: 'location', domain: location.domain, subdomain: location.subdomain })); error = domains.validateHostname(location.subdomain, domainObjectMap[location.domain]); - if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Bad location: ' + error.message, { field: 'location', location })); + if (error) return callback(new AppsError(AppsError.BAD_FIELD, 'Bad location: ' + error.message, { field: 'location', domain: location.domain, subdomain: location.subdomain })); } callback(null, domainObjectMap);