From 4a62c80e86e38894b502d0d85c190470bd40c2de Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= <skunk@xover.mud.at>
Date: Sat, 10 Aug 2019 17:19:41 +0200
Subject: [PATCH] OpenStreetBrowserLoader/CategoryIndex: loading: improve error
 messages

---
 src/CategoryIndex.js           | 4 ++--
 src/OpenStreetBrowserLoader.js | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/CategoryIndex.js b/src/CategoryIndex.js
index aa868371..408e0004 100644
--- a/src/CategoryIndex.js
+++ b/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)
     }
   })
 }
diff --git a/src/OpenStreetBrowserLoader.js b/src/OpenStreetBrowserLoader.js
index 25aac4a4..e8659ed9 100644
--- a/src/OpenStreetBrowserLoader.js
+++ b/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) {