-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Description
For some reason, sometimes I encounter the error Lone surrogate ... is not a scalar value. And this will make my entire app crash. By checking the detail, this is caused by an internal function in the utf8.js file:
function checkScalarValue(codePoint) {
if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
throw Error(
'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +
' is not a scalar value'
);
}
}
Is there a way to catch this error somehow in my client code, to avoid it crashing the whole server? Or else, some naughty boy could send invalid UTF string and keep crashing the server :(
Metadata
Metadata
Assignees
Labels
No labels