Skip to content

Commit

Permalink
add rejection handler
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroenwienk committed Apr 9, 2024
1 parent 800de29 commit 44673d7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ module.exports = class HomeyScriptApp extends Homey.App {
static RUN_TIMEOUT = 1000 * 30; // 30s

async onInit() {
// Remove since alot of them will be caused by user errors.
process.removeAllListeners('unhandledRejection');

process.on('unhandledRejection', (reason, promise) => {
this.error('Unhandled Rejection:', reason);
});

// Init Scripts
this.scripts = this.homey.settings.get('scripts');

Expand Down

0 comments on commit 44673d7

Please sign in to comment.