@devicefarmer/adbkit-monkey
Version:
A Node.js interface to the Android monkey tool.
32 lines (22 loc) • 548 B
JavaScript
(function() {
var Reply;
Reply = (function() {
Reply.ERROR = 'ERROR';
Reply.OK = 'OK';
function Reply(type, value) {
this.type = type;
this.value = value;
}
Reply.prototype.isError = function() {
return this.type === Reply.ERROR;
};
Reply.prototype.toError = function() {
if (!this.isError()) {
throw new Error('toError() cannot be called for non-errors');
}
return new Error(this.value);
};
return Reply;
})();
module.exports = Reply;
}).call(this);