aggregate-error-ponyfill
/
3.1.1
aggregate-error-ponyfill 3.1.1
Install from the command line:
Learn more about npm packages
$ npm install @flex-development/aggregate-error-ponyfill@3.1.1
Install via package.json:
"@flex-development/aggregate-error-ponyfill": "3.1.1"
About this version
This package is an ECMAScript Proposal spec-compliant ponyfill for AggregateError
.
Use this package when you want to throw AggregateError
objects in unsupported environments (< es2021
).
yarn add @flex-development/aggregate-error-ponyfill
From Git:
yarn add @flex-development/aggregate-error-ponyfill@flex-development/aggregate-error-ponyfill
See Git - Protocols | Yarn for details on requesting a specific branch, commit, or tag.
import AggregateError from '@flex-development/aggregate-error-ponyfill'
try {
throw new AggregateError([new Error('some error')], 'oh no!')
} catch (e) {
console.debug(e instanceof AggregateError) // true
console.error(e.name) // 'AggregateError'
console.error(e.message) // 'oh no!'
console.error(e.errors) // [Error: 'some error']
}
This package exports no identifiers.
The default export is AggregateError
.
Wrap several errors in a single error so that multiple errors can be reported by an operation.
An iterable of errors.
An optional human-readable description of the aggregate error.
An object that has the following properties:
The specific cause of the aggregate error.
When catching and re-throwing an error with a more-specific or useful error message, this property can be used to pass the original error.
This package is fully typed with TypeScript.
See CONTRIBUTING.md
.
Details
- aggregate-error-ponyfill
- flex-development
- over 1 year ago
- BSD-3-Clause
- 79 dependencies
Assets
- aggregate-error-ponyfill-3.1.1.tgz
Download activity
- Total downloads 3,029
- Last 30 days 677
- Last week 198
- Today 5