database-error.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. var __create = Object.create;
  2. var __defProp = Object.defineProperty;
  3. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  4. var __getOwnPropNames = Object.getOwnPropertyNames;
  5. var __getProtoOf = Object.getPrototypeOf;
  6. var __hasOwnProp = Object.prototype.hasOwnProperty;
  7. var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
  8. var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
  9. var __export = (target, all) => {
  10. __markAsModule(target);
  11. for (var name in all)
  12. __defProp(target, name, { get: all[name], enumerable: true });
  13. };
  14. var __reExport = (target, module2, desc) => {
  15. if (module2 && typeof module2 === "object" || typeof module2 === "function") {
  16. for (let key of __getOwnPropNames(module2))
  17. if (!__hasOwnProp.call(target, key) && key !== "default")
  18. __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
  19. }
  20. return target;
  21. };
  22. var __toModule = (module2) => {
  23. return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
  24. };
  25. var __publicField = (obj, key, value) => {
  26. __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  27. return value;
  28. };
  29. __export(exports, {
  30. default: () => database_error_default
  31. });
  32. var import_base_error = __toModule(require("./base-error"));
  33. class DatabaseError extends import_base_error.default {
  34. constructor(parent, options = {}) {
  35. super(parent.message);
  36. __publicField(this, "parent");
  37. __publicField(this, "original");
  38. __publicField(this, "sql");
  39. __publicField(this, "parameters");
  40. var _a;
  41. this.name = "SequelizeDatabaseError";
  42. this.parent = parent;
  43. this.original = parent;
  44. this.sql = parent.sql;
  45. this.parameters = (_a = parent.parameters) != null ? _a : {};
  46. if (options.stack) {
  47. this.stack = options.stack;
  48. }
  49. }
  50. }
  51. var database_error_default = DatabaseError;
  52. //# sourceMappingURL=database-error.js.map