Skip to content

Commit 00ccd86

Browse files
committed
Fixed #11: Improved deserializeMsgPack type error message
1 parent 385b017 commit 00ccd86

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

msgpack.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function deserializeMsgPack(array) {
321321
if (byte === 0xde) return readMap(-1, 2); // map 16
322322
if (byte === 0xdf) return readMap(-1, 4); // map 32
323323
if (byte >= 0xe0 && byte <= 0xff) return byte - 256; // negative fixint
324-
throw new Error("Matched no byte code. Value is " + byte + ". This should never happen.");
324+
throw new Error("The MessagePack binary data contains the value " + byte + " which is not a byte value (0 to 255). You cannot deserialize from a string, only byte arrays are supported. Please make sure you pass this function the correct binary data.");
325325
}
326326

327327
function readInt(size) {

msgpack.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)