index.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) 2015-present, Vitaly Tomilov
  3. *
  4. * See the LICENSE file at the top-level directory of this distribution
  5. * for licensing information.
  6. *
  7. * Removal or modification of this copyright notice is prohibited.
  8. */
  9. const {QueryResultError, queryResultErrorCode} = require('./query-result-error');
  10. const {PreparedStatementError} = require('./prepared-statement-error');
  11. const {ParameterizedQueryError} = require('./parameterized-query-error');
  12. const {QueryFileError} = require('./query-file-error');
  13. /**
  14. * @namespace errors
  15. * @description
  16. * Error types namespace, available as `pgp.errors`, before and after initializing the library.
  17. *
  18. * @property {function} PreparedStatementError
  19. * {@link errors.PreparedStatementError PreparedStatementError} class constructor.
  20. *
  21. * Represents all errors that can be reported by class {@link PreparedStatement}.
  22. *
  23. * @property {function} ParameterizedQueryError
  24. * {@link errors.ParameterizedQueryError ParameterizedQueryError} class constructor.
  25. *
  26. * Represents all errors that can be reported by class {@link ParameterizedQuery}.
  27. *
  28. * @property {function} QueryFileError
  29. * {@link errors.QueryFileError QueryFileError} class constructor.
  30. *
  31. * Represents all errors that can be reported by class {@link QueryFile}.
  32. *
  33. * @property {function} QueryResultError
  34. * {@link errors.QueryResultError QueryResultError} class constructor.
  35. *
  36. * Represents all result-specific errors from query methods.
  37. *
  38. * @property {errors.queryResultErrorCode} queryResultErrorCode
  39. * Error codes `enum` used by class {@link errors.QueryResultError QueryResultError}.
  40. *
  41. */
  42. module.exports = {
  43. QueryResultError,
  44. queryResultErrorCode,
  45. PreparedStatementError,
  46. ParameterizedQueryError,
  47. QueryFileError
  48. };