« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/thing.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/thing.js')
-rw-r--r--src/data/thing.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/data/thing.js b/src/data/thing.js
index f719224d..4fbad5f5 100644
--- a/src/data/thing.js
+++ b/src/data/thing.js
@@ -84,7 +84,13 @@ export default class Thing extends CacheableObject {
     }
 
     if (!thing.directory) {
-      throw TypeError(`Passed ${thing.constructor.name} is missing its directory`);
+      if (thing.name) {
+        throw TypeError(
+          `Passed ${thing.constructor.name} (named ${inspect(thing.name)}) ` +
+          `is missing its directory`);
+      } else {
+        throw TypeError(`Passed ${thing.constructor.name} is missing its directory`);
+      }
     }
 
     return `${thing.constructor[Thing.referenceType]}:${thing.directory}`;