Don't crash if CHANGESET_REQ fails

This commit is contained in:
Marcel Klehr 2013-12-17 16:20:57 +01:00
parent d1cad04647
commit adf05576b2
2 changed files with 6 additions and 2 deletions

View file

@ -203,7 +203,11 @@ Pad.prototype.getInternalRevisionAText = function getInternalRevisionAText(targe
{ {
curRev++; curRev++;
var cs = changesets[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); callback(null);

View file

@ -1255,7 +1255,7 @@ function handleChangesetRequest(client, message)
//build the requested rough changesets and send them back //build the requested rough changesets and send them back
getChangesetInfo(padIds.padId, start, end, granularity, function(err, changesetInfo) 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; var data = changesetInfo;
data.requestID = message.data.requestID; data.requestID = message.data.requestID;