Merge pfmooney/parser-error-handling

* pfmooney/parser-error-handling:
  Improve parser error handling
This commit is contained in:
Patrick Mooney 2014-04-04 15:14:32 -05:00
commit d530893cce
1 changed files with 8 additions and 2 deletions

View File

@ -113,8 +113,14 @@ Parser.prototype.getMessage = function (ber) {
var self = this;
var messageID = ber.readInt();
var type = ber.readSequence();
try {
var messageID = ber.readInt();
var type = ber.readSequence();
} catch (e) {
// Handle servers that aren't speaking the language at all
this.emit('error', e);
return false;
}
var Message;
switch (type) {