�PNG  IHDR��;���IDATx��ܻn�0���K�� �)(�pA��� ���7�LeG{�� �§㻢|��ذaÆ 6lذaÆ 6lذaÆ 6lom��$^�y���ذag�5bÆ 6lذaÆ 6lذa{���� 6lذaÆ �`����}H�Fkm�,�m����Ӫ���ô�ô!� �x�|'ܢ˟;�E:���9�&ᶒ�}�{�v]�n&�6� �h��_��t�ڠ͵-ҫ���Z;��Z$�.�P���k�ž)�!��o���>}l�eQfJ�T��u і���چ��\��X=8��Rن4`Vw�l�>����n�G�^��i�s��"ms�$�u��i��?w�bs[m�6�K4���O���.�4��%����/����b�C%��t ��M�ז� �-l�G6�mrz2���s�%�9��s@���-�k�9�=���)������k�B5����\��+͂�Zsٲ ��Rn��~G���R���C����� �wIcI��n7jJ���hۛNCS|���j0��8y�iHKֶۛ�k�Ɉ+;Sz������L/��F�*\��Ԕ�#"5��m�2��[S��������=�g��n�a�P�e�ғ�L�� lذaÆ 6l�^k��̱aÆ 6lذaÆ 6lذa;���� �_��ذaÆ 6lذaÆ 6lذaÆ ���R���IEND�B` # aggregate-error [![Build Status](https://travis-ci.org/sindresorhus/aggregate-error.svg?branch=master)](https://travis-ci.org/sindresorhus/aggregate-error) > Create an error from multiple errors ## Install ``` $ npm install aggregate-error ``` ## Usage ```js const AggregateError = require('aggregate-error'); const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]); throw error; /* AggregateError: Error: foo at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:33) Error: bar at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) Error: baz at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3) at Object. (/Users/sindresorhus/dev/aggregate-error/example.js:3:13) at Module._compile (module.js:556:32) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.runMain (module.js:590:10) at run (bootstrap_node.js:394:7) at startup (bootstrap_node.js:149:9) */ for (const individualError of error) { console.log(individualError); } //=> [Error: foo] //=> [Error: bar] //=> [Error: baz] ``` ## API ### AggregateError(errors) 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. #### errors Type: `Array` If a string, a new `Error` is created with the string as the error message.
If a non-Error object, a new `Error` is created with all properties from the object copied over.