We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3cb014a commit fcf3ca0Copy full SHA for fcf3ca0
1 file changed
src/datatypes/utils.js
@@ -1,5 +1,3 @@
1
-const assert = require('assert')
2
-
3
const { getCount, sendCount, calcCount, PartialReadError } = require('../utils')
4
5
module.exports = {
@@ -77,7 +75,7 @@ function readVarInt (buffer, offset) {
77
75
}
78
76
79
shift += 7 // we only have 7 bits, MSB being the return-trigger
80
- assert.ok(shift < 64, 'varint is too big') // Make sure our shift don't overflow.
+ if (shift > 64) throw new PartialReadError(`varint is too big: ${shift}`) // Make sure our shift don't overflow.
81
82
83
0 commit comments