@clickup/ent-framework
Version:
A PostgreSQL graph-database-alike library with microsharding and row-level security
29 lines • 1.29 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ShardIsNotDiscoverableError = void 0;
const ShardError_1 = require("./ShardError");
/**
* This non-retriable error is thrown when shardsDiscoverCache.cached() returns
* no shard with the requested number.
*/
class ShardIsNotDiscoverableError extends ShardError_1.ShardError {
constructor(shardNo, errors, islands, elapsed) {
super(`Shard ${shardNo} is not discoverable: no such Shard in the Cluster? some Islands are down? connections limit?` +
(errors.length > 0
? "\n" +
errors
.map(({ where, error, elapsed }) => `- ${where}` +
(elapsed !== null ? ` (took ${elapsed} ms)` : "") +
": " +
`${error?.toString() ?? error}`.trimEnd())
.sort()
.join("\n")
: ""), "Islands " +
islands
.map(({ no, clients }) => `${no}@${clients[0].options.name}`)
.join(", ") +
`; cached discovery took ${elapsed} ms`);
}
}
exports.ShardIsNotDiscoverableError = ShardIsNotDiscoverableError;
//# sourceMappingURL=ShardIsNotDiscoverableError.js.map
;