Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Add 'stop' event emission on error in sparkplugNode (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGodbehere authored Sep 28, 2023
1 parent 8d4e530 commit 26cea22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ async function getNewConfig(interval: number) {
}
log('Config fetched.');
return config;
}
}
1 change: 1 addition & 0 deletions lib/sparkplugNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ export class SparkplugNode extends (
*/
onError(error: Error) {
log(`Client received error: ${error}`);
this.emit('stop');
}

/**
Expand Down

0 comments on commit 26cea22

Please sign in to comment.