@carlosv2/glue
Version:
Dependency injection library that stays out of the way
15 lines (14 loc) • 452 B
JavaScript
import { DiError } from '../error.js';
export class AggregatedError extends DiError {
constructor(...errors) {
const messages = errors
.map(error => {
return error.message
.split('\n')
.map(line => ` ${line}`)
.join('\n');
})
.join('\n\n');
super(`This is an aggregated error triggered by the following ones:\n\n${messages}\n\n`);
}
}