mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 09:20:03 +02:00
fixed error parsing issue
This commit is contained in:
parent
51bed71e1b
commit
543f5986ae
3 changed files with 17 additions and 8 deletions
|
@ -31,11 +31,9 @@ var Command = Backbone.Model.extend({
|
|||
this.parse();
|
||||
} catch (err) {
|
||||
if (err instanceof CommandProcessError ||
|
||||
err instanceof GitError) {
|
||||
this.set('status', 'error');
|
||||
this.set('error', err);
|
||||
} else if (err instanceof CommandResult) {
|
||||
this.set('status', 'finished');
|
||||
err instanceof GitError ||
|
||||
err instanceof CommandResult) {
|
||||
// erroChanged() will handle status and all of that
|
||||
this.set('error', err);
|
||||
} else {
|
||||
throw err;
|
||||
|
@ -44,13 +42,17 @@ var Command = Backbone.Model.extend({
|
|||
},
|
||||
|
||||
errorChanged: function(model, err) {
|
||||
this.set('err', err);
|
||||
this.set('status', 'error');
|
||||
if (err instanceof CommandProcessError ||
|
||||
err instanceof GitError) {
|
||||
this.set('status', 'error');
|
||||
} else if (err instanceof CommandResult) {
|
||||
this.set('status', 'finished');
|
||||
}
|
||||
this.formatError();
|
||||
},
|
||||
|
||||
formatError: function() {
|
||||
this.set('result', this.get('err').toResult());
|
||||
this.set('result', this.get('error').toResult());
|
||||
},
|
||||
|
||||
getShortcutMap: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue