"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isInvalidCapacityError = exports.ensureCapacity = exports.InvalidCapacityError = exports.InvalidCapacityErrorSymbol = void 0;
// ets_tracing: off
require("../../Operator");
exports.InvalidCapacityErrorSymbol = Symbol.for("@effect-ts/core/symbols/errors/InvalidCapacity");
class InvalidCapacityError extends Error {
    constructor(message) {
        super(message);
        this[_a] = "InvalidCapacityError";
        this.name = this[exports.InvalidCapacityErrorSymbol];
    }
}
exports.InvalidCapacityError = InvalidCapacityError;
_a = exports.InvalidCapacityErrorSymbol;
function ensureCapacity(capacity) {
    if (capacity <= 0) {
        throw new InvalidCapacityError(`A Hub cannot have a capacity of ${capacity}`);
    }
}
exports.ensureCapacity = ensureCapacity;
function isInvalidCapacityError(u) {
    return u instanceof Error && u[exports.InvalidCapacityErrorSymbol] === "InvalidCapacityError";
}
exports.isInvalidCapacityError = isInvalidCapacityError;
//# sourceMappingURL=errors.js.map