fixing some more bugs

This commit is contained in:
Peter Cottle 2012-09-15 23:32:06 -07:00
parent 8ebb53b983
commit 94db9a3c7d
6 changed files with 37 additions and 11 deletions

View file

@ -692,7 +692,21 @@ GitEngine.prototype.dispatch = function(command, callback) {
});
command.set('status', 'processing');
this[command.get('method') + 'Starter']();
try {
this[command.get('method') + 'Starter']();
} catch (err) {
if (err instanceof GitError ||
err instanceof CommandResult) {
// short circuit animation by just setting error and returning
command.set('error', err);
callback();
return;
} else {
throw err;
}
}
// TODO (get rid of)
for (var i = 0; i < 3; i++) {