Skip to content

Commit 131ed17

Browse files
sventschuimarvinhagemeister
authored andcommitted
Always throw errors, not strings (#129)
1 parent 131a807 commit 131ed17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) {
201201
}
202202

203203
s = `<${nodeName}${s}>`;
204-
if (String(nodeName).match(/[\s\n\\/='"\0<>]/)) throw s;
204+
if (String(nodeName).match(/[\s\n\\/='"\0<>]/)) throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`);
205205

206206
let isVoid = String(nodeName).match(VOID_ELEMENTS);
207207
if (isVoid) s = s.replace(/>$/, ' />');

0 commit comments

Comments
 (0)