nestjs-resilience
Version:
A module for improving the reliability and fault-tolerance of your NestJS applications
16 lines (15 loc) • 571 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.HealthCheckStrategy = void 0;
const base_strategy_1 = require("./base.strategy");
const rxjs_1 = require("rxjs");
const exceptions_1 = require("../exceptions");
class HealthCheckStrategy extends base_strategy_1.Strategy {
constructor(options) {
super(options);
}
process(observable) {
return this.options() ? observable : (0, rxjs_1.throwError)(() => new exceptions_1.HealthCheckFailedException());
}
}
exports.HealthCheckStrategy = HealthCheckStrategy;
;