mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-10 06:34:26 +02:00
have visual refs working and better error models
This commit is contained in:
parent
9221088853
commit
af76c03ad1
10 changed files with 212 additions and 74 deletions
|
@ -1,31 +1,35 @@
|
|||
function CommandProcessError(msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
var MyError = Backbone.Model.extend({
|
||||
defaults: {
|
||||
type: 'MyError',
|
||||
msg: 'Unknown Error'
|
||||
},
|
||||
toString: function() {
|
||||
return this.get('type') + ': ' + this.get('msg');
|
||||
},
|
||||
|
||||
CommandProcessError.prototype.toString = function() {
|
||||
return 'Command Process Error: ' + this.msg;
|
||||
};
|
||||
getMsg: function() {
|
||||
return this.get('msg') || 'Unknown Error';
|
||||
},
|
||||
|
||||
CommandProcessError.prototype.toResult = function() {
|
||||
return this.msg.replace('\n', '</br>');
|
||||
};
|
||||
toResult: function() {
|
||||
return this.get('msg').replace('\n', '</br>');
|
||||
}
|
||||
});
|
||||
|
||||
function CommandResult(msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
var CommandProcessError = MyError.extend({
|
||||
defaults: {
|
||||
type: 'Command Process Error'
|
||||
}
|
||||
});
|
||||
|
||||
CommandResult.prototype.toString = function() {
|
||||
return 'Command Result: ' + this.msg;
|
||||
};
|
||||
var CommandResult = MyError.extend({
|
||||
defaults: {
|
||||
type: 'Command Result'
|
||||
}
|
||||
});
|
||||
|
||||
CommandResult.prototype.toResult = function() {
|
||||
return this.msg.replace('\n', '</br>');
|
||||
};
|
||||
|
||||
function GitError(msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
GitError.prototype.toString = function() {
|
||||
return 'Git Error: ' + this.msg;
|
||||
};
|
||||
var GitError = MyError.extend({
|
||||
defaults: {
|
||||
type: 'Git Error'
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue