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) {
186186 * @param {number } type
187187 * @returns {undefined }
188188 */
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+ )
190195 parser . buffer = null
191- parser . returnFatalError ( error )
196+ parser . returnFatalError ( err )
192197}
193198
194199/**
@@ -296,11 +301,7 @@ function parseType (parser, type) {
296301 case 45 :
297302 return parseError ( parser )
298303 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 )
304305 }
305306}
306307
You can’t perform that action at this time.
0 commit comments