File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -186,9 +186,14 @@ function parseError (parser) {
186
186
* @param {number } type
187
187
* @returns {undefined }
188
188
*/
189
- function handleError ( parser , error ) {
189
+ function handleError ( parser , type ) {
190
+ const err = new ParserError (
191
+ 'Protocol error, got ' + JSON . stringify ( String . fromCharCode ( type ) ) + ' as reply type byte' ,
192
+ JSON . stringify ( parser . buffer ) ,
193
+ parser . offset
194
+ )
190
195
parser . buffer = null
191
- parser . returnFatalError ( error )
196
+ parser . returnFatalError ( err )
192
197
}
193
198
194
199
/**
@@ -296,11 +301,7 @@ function parseType (parser, type) {
296
301
case 45 :
297
302
return parseError ( parser )
298
303
default :
299
- return handleError ( parser , new ParserError (
300
- 'Protocol error, got ' + JSON . stringify ( String . fromCharCode ( type ) ) + ' as reply type byte' ,
301
- JSON . stringify ( parser . buffer ) ,
302
- parser . offset
303
- ) )
304
+ return handleError ( parser , type )
304
305
}
305
306
}
306
307
You can’t perform that action at this time.
0 commit comments