Fix error message in UhkBuffer
This commit is contained in:
@@ -133,8 +133,8 @@ export class UhkBuffer {
|
|||||||
let stringByteLength = Buffer.byteLength(str, UhkBuffer.stringEncoding);
|
let stringByteLength = Buffer.byteLength(str, UhkBuffer.stringEncoding);
|
||||||
|
|
||||||
if (stringByteLength > UhkBuffer.maxCompactLength) {
|
if (stringByteLength > UhkBuffer.maxCompactLength) {
|
||||||
throw 'Cannot serialize string: ${stringByteLength} bytes is larger ' +
|
throw `Cannot serialize string: ${stringByteLength} bytes is larger
|
||||||
'than the maximum allowed length of ${UhkBuffer.maxStringByteLength} bytes';
|
than the maximum allowed length of ${UhkBuffer.maxCompactLength} bytes`;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.writeCompactLength(stringByteLength);
|
this.writeCompactLength(stringByteLength);
|
||||||
|
|||||||
Reference in New Issue
Block a user