Skip to content

Commit 22f432e

Browse files
committed
Bind load with Q
1 parent 7700a09 commit 22f432e

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

example/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ app.load([
1414
return app.load([
1515
'./test3'
1616
]);
17+
}).fail(function(err) {
18+
console.log("Error with example",err);
1719
});
1820

lib/application.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var Application = function(config, basePlugins) {
2828
};
2929

3030
// Load some plugins
31-
this.load = function(plugins) {
31+
this.load = Q.fbind(function(plugins) {
3232
// Resolve Complete configuration for plugins
3333
plugins = this.config.resolvePlugins(plugins);
3434

@@ -55,7 +55,7 @@ var Application = function(config, basePlugins) {
5555
that.emit("error", err);
5656
return Q.reject(err);
5757
});
58-
};
58+
});
5959

6060
// Check dependencies
6161
// -> check cycle
@@ -124,8 +124,8 @@ var Application = function(config, basePlugins) {
124124

125125
console.error("Could not resolve dependencies of these plugins:", plugins);
126126
console.error("Resolved services:", Object.keys(that.resolved));
127-
console.error("Missing services:", unresolved);
128-
throw new Error("Could not resolve dependencies");
127+
console.error("Missing services:", Object.keys(unresolved));
128+
throw new Error("Could not resolve dependencies: "+ JSON.stringify(Object.keys(that.resolved)));
129129
}
130130

131131
return sorted;

0 commit comments

Comments
 (0)