Skip to content

Commit

Permalink
fix: catch unhandled exception on deploy in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
hayes committed Apr 7, 2021
1 parent 7aa3f8f commit 2414e65
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/server/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ module.exports = class Client {
this.hooks.syncSkipped.call(this.files, stats);
} else {
this.hooks.sync.call(this.files, stats);
await sync(this.files);
this.hooks.syncDone.call(this.files, stats);
sync(this.files)
.then(() => this.hooks.syncDone.call(this.files, stats))
.catch((e) => console.error(e.message || e));
}

await this.hooks.afterSync.promise(this.files, stats);
Expand Down
2 changes: 1 addition & 1 deletion src/server/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function getDeploymentSettings(replace) {
}

module.exports = {
sync(files = []) {
async sync(files = []) {
if (!files.length) {
return Promise.reject(new Error('No files to deploy.'));
}
Expand Down

0 comments on commit 2414e65

Please sign in to comment.