Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

readme.md 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 aggregate-error
  6. ```
  7. ## Usage
  8. ```js
  9. const AggregateError = require('aggregate-error');
  10. const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);
  11. throw error;
  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. Error: baz
  19. at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
  20. at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
  21. at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
  22. at Module._compile (module.js:556:32)
  23. at Object.Module._extensions..js (module.js:565:10)
  24. at Module.load (module.js:473:32)
  25. at tryModuleLoad (module.js:432:12)
  26. at Function.Module._load (module.js:424:3)
  27. at Module.runMain (module.js:590:10)
  28. at run (bootstrap_node.js:394:7)
  29. at startup (bootstrap_node.js:149:9)
  30. */
  31. for (const individualError of error) {
  32. console.log(individualError);
  33. }
  34. //=> [Error: foo]
  35. //=> [Error: bar]
  36. //=> [Error: baz]
  37. ```
  38. ## API
  39. ### AggregateError(errors)
  40. Returns an `Error` that is also an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Iterables) for the individual errors.
  41. #### errors
  42. Type: `Array<Error|Object|string>`
  43. If a string, a new `Error` is created with the string as the error message.<br>
  44. If a non-Error object, a new `Error` is created with all properties from the object copied over.