Skip to content

Commit

Permalink
[FIX] Error Handling: Prevent UnhandledRejection
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Apr 1, 2020
1 parent db5cdd5 commit 4e1db52
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,12 @@ class Framework {
}

// this.addPreprocessor();
this.setupMiddleware();
this.setupMiddleware().catch((error) => {
this.logger.log("error", error);
// Can't throw an error here as it won't be caught
// Therefore just killing the process...
process.exit(1);
});
return this;
}

Expand Down

0 comments on commit 4e1db52

Please sign in to comment.