mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-10 06:34:26 +02:00
event refactor and errors
This commit is contained in:
parent
4f30ad73a8
commit
3d1890bb3b
3 changed files with 111 additions and 36 deletions
23
src/errors.js
Normal file
23
src/errors.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
function CommandProcessError(msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
CommandProcessError.prototype = _.copy(Error.prototype);
|
||||
|
||||
CommandProcessError.prototype.toString = function() {
|
||||
return 'Command Process Error: ' + this.msg;
|
||||
};
|
||||
|
||||
function CommandResult(msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
CommandResult.prototype = _.copy(Error.prototype);
|
||||
|
||||
CommandResult.prototype.toString = function() {
|
||||
return 'Command Result: ' + this.msg;
|
||||
};
|
||||
|
||||
CommandResult.prototype.toResult = function() {
|
||||
return this.msg.replace('\n', '</br>');
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue