errors.js 988 B

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.WaitQueueTimeoutError = exports.PoolClosedError = void 0;
  4. const error_1 = require("../error");
  5. /**
  6. * An error indicating a connection pool is closed
  7. * @category Error
  8. */
  9. class PoolClosedError extends error_1.MongoDriverError {
  10. constructor(pool) {
  11. super('Attempted to check out a connection from closed connection pool');
  12. this.address = pool.address;
  13. }
  14. get name() {
  15. return 'MongoPoolClosedError';
  16. }
  17. }
  18. exports.PoolClosedError = PoolClosedError;
  19. /**
  20. * An error thrown when a request to check out a connection times out
  21. * @category Error
  22. */
  23. class WaitQueueTimeoutError extends error_1.MongoDriverError {
  24. constructor(message, address) {
  25. super(message);
  26. this.address = address;
  27. }
  28. get name() {
  29. return 'MongoWaitQueueTimeoutError';
  30. }
  31. }
  32. exports.WaitQueueTimeoutError = WaitQueueTimeoutError;
  33. //# sourceMappingURL=errors.js.map