From 2b7c3305d916875e98d33102d50ab562834b1e0a Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 24 Oct 2025 06:42:27 -0300 Subject: data: Thing.getReference: include name in missing directory throw --- src/data/thing.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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}`; -- cgit 1.3.0-6-gf8a5