error.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. "use strict";
  2. var __extends = (this && this.__extends) || (function () {
  3. var extendStatics = function (d, b) {
  4. extendStatics = Object.setPrototypeOf ||
  5. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  6. function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
  7. return extendStatics(d, b);
  8. };
  9. return function (d, b) {
  10. if (typeof b !== "function" && b !== null)
  11. throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
  12. extendStatics(d, b);
  13. function __() { this.constructor = d; }
  14. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  15. };
  16. })();
  17. Object.defineProperty(exports, "__esModule", { value: true });
  18. exports.BSONTypeError = exports.BSONError = void 0;
  19. /** @public */
  20. var BSONError = /** @class */ (function (_super) {
  21. __extends(BSONError, _super);
  22. function BSONError(message) {
  23. var _this = _super.call(this, message) || this;
  24. Object.setPrototypeOf(_this, BSONError.prototype);
  25. return _this;
  26. }
  27. Object.defineProperty(BSONError.prototype, "name", {
  28. get: function () {
  29. return 'BSONError';
  30. },
  31. enumerable: false,
  32. configurable: true
  33. });
  34. return BSONError;
  35. }(Error));
  36. exports.BSONError = BSONError;
  37. /** @public */
  38. var BSONTypeError = /** @class */ (function (_super) {
  39. __extends(BSONTypeError, _super);
  40. function BSONTypeError(message) {
  41. var _this = _super.call(this, message) || this;
  42. Object.setPrototypeOf(_this, BSONTypeError.prototype);
  43. return _this;
  44. }
  45. Object.defineProperty(BSONTypeError.prototype, "name", {
  46. get: function () {
  47. return 'BSONTypeError';
  48. },
  49. enumerable: false,
  50. configurable: true
  51. });
  52. return BSONTypeError;
  53. }(TypeError));
  54. exports.BSONTypeError = BSONTypeError;
  55. //# sourceMappingURL=error.js.map