aggregate-error

WebJar for aggregate-error

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

aggregate-error
Последняя версия

Последняя версия

3.1.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

aggregate-error
WebJar for aggregate-error
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/sindresorhus/aggregate-error

Скачать aggregate-error

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/aggregate-error/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>aggregate-error</artifactId>
    <version>3.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/aggregate-error/
implementation 'org.webjars.npm:aggregate-error:3.1.0'
// https://jarcasting.com/artifacts/org.webjars.npm/aggregate-error/
implementation ("org.webjars.npm:aggregate-error:3.1.0")
'org.webjars.npm:aggregate-error:jar:3.1.0'
<dependency org="org.webjars.npm" name="aggregate-error" rev="3.1.0">
  <artifact name="aggregate-error" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='aggregate-error', version='3.1.0')
)
libraryDependencies += "org.webjars.npm" % "aggregate-error" % "3.1.0"
[org.webjars.npm/aggregate-error "3.1.0"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.npm : clean-stack jar [2.0.0,3)
org.webjars.npm : indent-string jar [4.0.0,5)

Модули Проекта

Данный проект не имеет модулей.

aggregate-error Build Status

Create an error from multiple errors

Note: With Node.js 15, there's now a built-in AggregateError type.

Install

$ npm install aggregate-error

Usage

const AggregateError = require('aggregate-error');

const error = new AggregateError([new Error('foo'), 'bar', {message: 'baz'}]);

throw error;
/*
AggregateError:
    Error: foo
        at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:33)
    Error: bar
        at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
    Error: baz
        at Object.<anonymous> (/Users/sindresorhus/dev/aggregate-error/example.js:3:13)
    at AggregateError (/Users/sindresorhus/dev/aggregate-error/index.js:19:3)
    at Object.<anonymous> (/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 for the individual errors.

errors

Type: Array<Error|Object|string>

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.

Версии библиотеки

Версия
3.1.0
3.0.1