From aae79c4f79ca0cf8a24bdee6c33b0fb45ea64f28 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Wed, 6 May 2020 11:05:34 +0200 Subject: [PATCH] better error --- lib/Element.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Element.ts b/lib/Element.ts index 9c625d3..275b8e5 100644 --- a/lib/Element.ts +++ b/lib/Element.ts @@ -16,7 +16,7 @@ export class Element { const new_name = val.replace (/[^a-z0-9]/giu, '') .replace (/^[0-9]+/iu, ''); if (new_name === '') - throw new Error ('invalid name specified'); + throw new Error (`invalid node name ${val}`); this._name = new_name; }