Skip to content

Commit

Permalink
updated error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzod committed Jun 5, 2017
1 parent b20e775 commit ad6f109
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ember-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,14 @@ class EmberApp {
return this.buildAppInstance()
.then(instance => {
result.instance = instance;
return new Promise(function(resolve, reject) {
return new Promise((resolve, reject) => {
let timer;
if (destroyAppInstanceInMs > 0) {
// start a timer to destroy the appInstance forcefully in the given ms.
// This is a failure mechanism so that node process doesn't get wedged if the `visit` never completes.
timer = setTimeout(()=> {
timer = setTimeout(() => {
if (result._destroyAppInstance()) {
reject(new Error('App instance was forcefully destroyed in ' + destroyAppInstanceInMs + 'ms'));
reject(new Error('Fastboot forcefully destroyed App instance in ' + destroyAppInstanceInMs + 'ms'));
}
}, destroyAppInstanceInMs);
}
Expand Down
4 changes: 2 additions & 2 deletions test/fastboot-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ describe("FastBoot", function() {
distPath: fixture('long-resolving-app')
});

fastboot.visit('/', { destroyAppInstanceInMs: 300 })
fastboot.visit('/', { destroyAppInstanceInMs: 5 })
.catch((e) => {
expect(e.message).to.equal('App instance was forcefully destroyed in 300ms');
expect(e.message).to.equal('Fastboot forcefully destroyed App instance in 5ms');
done();
});
});
Expand Down

0 comments on commit ad6f109

Please sign in to comment.