better error
This commit is contained in:
parent
c56a6616ca
commit
aae79c4f79
@ -16,7 +16,7 @@ export class Element {
|
|||||||
const new_name = val.replace (/[^a-z0-9]/giu, '')
|
const new_name = val.replace (/[^a-z0-9]/giu, '')
|
||||||
.replace (/^[0-9]+/iu, '');
|
.replace (/^[0-9]+/iu, '');
|
||||||
if (new_name === '')
|
if (new_name === '')
|
||||||
throw new Error ('invalid name specified');
|
throw new Error (`invalid node name ${val}`);
|
||||||
this._name = new_name;
|
this._name = new_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user