Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
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.

60 lines
1.5 KiB

  1. # aggregate-error [![Build Status](https://travis-ci.org/sindresorhus/aggregate-error.svg?branch=master)](https://travis-ci.org/sindresorhus/aggregate-error)
  2. > Create an error from multiple errors
  3. ## Install
  4. ```
  5. $ npm install --save aggregate-error
  6. ```
  7. ## Usage
  8. ```js
  9. const AggregateError = require('aggregate-error');
  10. const err = new AggregateError([new Error('foo'), 'bar']);
  11. throw err;
  12. /*
  13. AggregateError:
  14. Error: foo
  15. at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)
  16. Error: bar
  17. at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
  18. at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
  19. at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
  20. at Module._compile (module.js:556:32)
  21. at Object.Module._extensions..js (module.js:565:10)
  22. at Module.load (module.js:473:32)
  23. at tryModuleLoad (module.js:432:12)
  24. at Function.Module._load (module.js:424:3)
  25. at Module.runMain (module.js:590:10)
  26. at run (bootstrap_node.js:394:7)
  27. at startup (bootstrap_node.js:149:9)
  28. */
  29. for (const el of err) {
  30. console.log(el);
  31. }
  32. //=> [Error: foo]
  33. //=> [Error: bar]
  34. ```
  35. ## API
  36. ### AggregateError(errors)
  37. Returns an `Error` that is also an [`iterator`](https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Iterators_and_Generators) for the individual errors.
  38. #### errors
  39. Type: `Iterable<Error|string>`
  40. ## License
  41. MIT © [Sindre Sorhus](https://sindresorhus.com)