Merge pull request #2039 from ether/fix/dont-crash-on-failed-changeset_req

Don't crash if CHANGESET_REQ fails
This commit is contained in:
John McLear 2013-12-17 07:42:05 -08:00
commit af5b8d3e24
2 changed files with 6 additions and 2 deletions

View file

@ -203,7 +203,11 @@ Pad.prototype.getInternalRevisionAText = function getInternalRevisionAText(targe
{
curRev++;
var cs = changesets[curRev];
atext = Changeset.applyToAText(cs, atext, apool);
try{
atext = Changeset.applyToAText(cs, atext, apool);
}catch(e) {
return callback(e)
}
}
callback(null);

View file

@ -1255,7 +1255,7 @@ function handleChangesetRequest(client, message)
//build the requested rough changesets and send them back
getChangesetInfo(padIds.padId, start, end, granularity, function(err, changesetInfo)
{
ERR(err);
if(err) return console.error('Error while handling a changeset request for '+padIds.padId, err, message.data);
var data = changesetInfo;
data.requestID = message.data.requestID;