Skip to content

Commit

Permalink
feat(container): use new logging AggregateError
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Mar 25, 2015
1 parent 667a16e commit 6e2548e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -11,6 +11,7 @@ This library is part of the [Aurelia](http://www.aurelia.io/) platform and conta
## Dependencies

* [aurelia-metadata](https://github.com/aurelia/metadata)
* [aurelia-logging](https://github.com/aurelia/logging)

## Used By

Expand Down
1 change: 1 addition & 0 deletions config.js
Expand Up @@ -9,6 +9,7 @@ System.config({

System.config({
"map": {
"aurelia-logging": "github:aurelia/logging@0.2.5",
"aurelia-metadata": "github:aurelia/metadata@0.3.3",
"core-js": "npm:core-js@0.4.6",
"github:jspm/nodelibs-process@0.1.0": {
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -26,6 +26,7 @@
"lib": "dist/system"
},
"dependencies": {
"aurelia-logging": "github:aurelia/logging@^0.2.5",
"aurelia-metadata": "github:aurelia/metadata@^0.3.3",
"core-js": "npm:core-js@^0.4.1"
}
Expand Down
7 changes: 3 additions & 4 deletions src/container.js
@@ -1,4 +1,5 @@
import {Metadata} from 'aurelia-metadata';
import {AggregateError} from 'aurelia-logging';
import {Resolver, Registration, Factory} from './metadata';

var emptyParameters = Object.freeze([]);
Expand Down Expand Up @@ -268,7 +269,7 @@ export class Container {
var info = this.getOrCreateConstructionInfo(fn),
keys = info.keys,
args = new Array(keys.length),
context, key, keyName, error, i, ii;
context, key, keyName, i, ii;

try{
for(i = 0, ii = keys.length; i < ii; ++i){
Expand All @@ -278,9 +279,7 @@ export class Container {
}
catch(e){
keyName = typeof key === 'function' ? key.name : key;
error = new Error(`Error resolving dependency [${keyName}] required by [${fn.name}].`);
error.innerError = e;
throw error;
throw new AggregateError(`Error resolving dependency [${keyName}] required by [${fn.name}].`, e);
}

if(info.isFactory){
Expand Down

0 comments on commit 6e2548e

Please sign in to comment.