AggregateError.js 756 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.AggregateError = void 0;
  4. class AggregateError extends Error {
  5. constructor(errors) {
  6. super();
  7. this.errors = errors;
  8. this.name = 'AggregateError';
  9. }
  10. toString() {
  11. const message = `AggregateError of:\n${this.errors
  12. .map((error) => error === this
  13. ? '[Circular AggregateError]'
  14. : error instanceof AggregateError
  15. ? String(error).replace(/\n$/, '').replace(/^/gm, ' ')
  16. : String(error).replace(/^/gm, ' ').substring(2))
  17. .join('\n')}\n`;
  18. return message;
  19. }
  20. }
  21. exports.AggregateError = AggregateError;
  22. //# sourceMappingURL=AggregateError.js.map