better error

This commit is contained in:
Timo Hocker 2020-05-06 11:05:34 +02:00
parent c56a6616ca
commit aae79c4f79

View File

@ -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;
}