You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

errors.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.XRPLFaucetError = exports.NotFoundError = exports.ValidationError = exports.ResponseFormatError = exports.TimeoutError = exports.RippledNotInitializedError = exports.DisconnectedError = exports.NotConnectedError = exports.RippledError = exports.ConnectionError = exports.UnexpectedError = exports.XrplError = void 0;
  4. const util_1 = require("util");
  5. class XrplError extends Error {
  6. constructor(message = '', data) {
  7. super(message);
  8. this.name = this.constructor.name;
  9. this.message = message;
  10. this.data = data;
  11. if (Error.captureStackTrace != null) {
  12. Error.captureStackTrace(this, this.constructor);
  13. }
  14. }
  15. toString() {
  16. let result = `[${this.name}(${this.message}`;
  17. if (this.data) {
  18. result += `, ${(0, util_1.inspect)(this.data)}`;
  19. }
  20. result += ')]';
  21. return result;
  22. }
  23. inspect() {
  24. return this.toString();
  25. }
  26. }
  27. exports.XrplError = XrplError;
  28. class RippledError extends XrplError {
  29. }
  30. exports.RippledError = RippledError;
  31. class UnexpectedError extends XrplError {
  32. }
  33. exports.UnexpectedError = UnexpectedError;
  34. class ConnectionError extends XrplError {
  35. }
  36. exports.ConnectionError = ConnectionError;
  37. class NotConnectedError extends ConnectionError {
  38. }
  39. exports.NotConnectedError = NotConnectedError;
  40. class DisconnectedError extends ConnectionError {
  41. }
  42. exports.DisconnectedError = DisconnectedError;
  43. class RippledNotInitializedError extends ConnectionError {
  44. }
  45. exports.RippledNotInitializedError = RippledNotInitializedError;
  46. class TimeoutError extends ConnectionError {
  47. }
  48. exports.TimeoutError = TimeoutError;
  49. class ResponseFormatError extends ConnectionError {
  50. }
  51. exports.ResponseFormatError = ResponseFormatError;
  52. class ValidationError extends XrplError {
  53. }
  54. exports.ValidationError = ValidationError;
  55. class XRPLFaucetError extends XrplError {
  56. }
  57. exports.XRPLFaucetError = XRPLFaucetError;
  58. class NotFoundError extends XrplError {
  59. constructor(message = 'Not found') {
  60. super(message);
  61. }
  62. }
  63. exports.NotFoundError = NotFoundError;
  64. //# sourceMappingURL=errors.js.map