tsbase
Version:
Base class libraries for TypeScript
23 lines • 755 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AsyncCommand = void 0;
const Result_1 = require("../Result/Result");
const module_1 = require("../../Utility/Logger/module");
class AsyncCommand {
constructor(AsyncCommand) {
this.AsyncCommand = AsyncCommand;
}
async Execute() {
const result = new Result_1.Result(null);
try {
await this.AsyncCommand();
}
catch (error) {
result.ErrorMessages.push(error.message);
module_1.Logger.Instance.Log(new module_1.LogEntry(error.message, module_1.LogLevel.Error, error));
}
return result;
}
}
exports.AsyncCommand = AsyncCommand;
//# sourceMappingURL=AsyncCommand.js.map