Skip to content

Commit

Permalink
Add try/catch to contribution calls in backend-application
Browse files Browse the repository at this point in the history
Signed-off-by: Antoine Tremblay <antoine.tremblay@ericsson.com>
  • Loading branch information
Antoine Tremblay authored and Antoine Tremblay committed Oct 4, 2017
1 parent 6c93c3e commit f383ce3
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/core/src/node/backend-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,21 @@ export class BackendApplication {

for (const contribution of this.contributionsProvider.getContributions()) {
if (contribution.initialize) {
contribution.initialize();
try {
contribution.initialize();
} catch (err) {
this.logger.error(err.toString());
}
}
}

for (const contribution of this.contributionsProvider.getContributions()) {
if (contribution.configure) {
contribution.configure(this.app);
try {
contribution.configure(this.app);
} catch (err) {
this.logger.error(err.toString());
}
}
}
}
Expand All @@ -69,7 +77,11 @@ export class BackendApplication {

for (const contrib of this.contributionsProvider.getContributions()) {
if (contrib.onStart) {
contrib.onStart(server);
try {
contrib.onStart(server);
} catch (err) {
this.logger.error(err.toString());
}
}
}
});
Expand Down

0 comments on commit f383ce3

Please sign in to comment.