Browse Source

OpenStreetBrowserLoader/CategoryIndex: loading: improve error messages

master
parent
commit
4a62c80e86
  1. 4
      src/CategoryIndex.js
  2. 2
      src/OpenStreetBrowserLoader.js

4
src/CategoryIndex.js

@ -11,9 +11,9 @@ function CategoryIndex (options, data, repository) {
this.childrenDoms = {}
this.childrenCategories = null
this._loadChildrenCategories(function (err) {
this._loadChildrenCategories((err) => {
if (err) {
console.log('error loading child categories:', err)
console.log('Category "' + this.id + '": error loading child categories:', err)
}
})
}

2
src/OpenStreetBrowserLoader.js

@ -55,7 +55,7 @@ OpenStreetBrowserLoader.prototype.getCategory = function (id, options, callback)
}
if (!(ids.entityId in repoData.categories)) {
return callback(new Error('category not defined'), null)
return callback(new Error('category "' + ids.entityId + '" not defined'), null)
}
this.getCategoryFromData(ids.id, opt, repoData.categories[ids.entityId], function (err, category) {

Loading…
Cancel
Save