Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Don't swallow exceptions in javascript parser #372

Closed
wants to merge 1 commit into from

3 participants

@jaclar

This fixes issue #325.

@rauchg

+1

@DTrejo
Collaborator

duplicate of #361, closing, but thank you much for submitting.

@DTrejo DTrejo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 7, 2013
  1. Catch only the "too far" parser error, so on("message") wont swallow …

    Lars Jacob authored
    …your uncaught exceptions
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 4 deletions.
  1. +9 −4 lib/parser/javascript.js
View
13 lib/parser/javascript.js
@@ -211,10 +211,15 @@ ReplyParser.prototype.execute = function (buffer) {
this.send_reply(ret);
}
} catch (err) {
- // catch the error (not enough data), rewind, and wait
- // for the next packet to appear
- this._offset = offset;
- break;
+ if (err === "to far") {
+ // catch the error (not enough data), rewind, and wait
+ // for the next packet to appear
+ this._offset = offset;
+ break;
+ } else {
+ // pass on all the other errors
+ throw err;
+ }
}
}
};
Something went wrong with that request. Please try again.